Adderabbi has an excellent post ( Mistaken Minhag - Not Answering 'Amen' to the Second Bracha of Shema: The Unabridged Version") tracing this halacha from the sources. He concludes
the Mishna Berurah INVENTS a doubt about what to do in that scenario, INVENTS a machloket between Ramah and Rambam, and then reads it back into the Shulkhan Arukh!
I would like to explain the basis for the psak of the Mishna Berura and show that it was not a mistake and that it has a solid basis. To really understand this post you should read Adderabbi's post first.
The Tur in Siman 59 brings down a Rosh. The Rosh says that his practice was to say the words of bircas krias shema with the chazan, but that it’s proper for one to finish up the bracha before the sha”tz so that he can answer ‘amen’, because it’s inappropriate to do so if he finishes along with the sha”tz (because then it would be like answering ‘amen’ to his own bracha). The Rosh furthermore doesn’t differentiate between the brachot of ‘yotzer’ and ‘ha-bocher’. The same practice should apply for both, namely finish before the chazzan and answer amen.
The Beis Yosef there is bothered by the following question. He asks how can the Rosh have answered amen to הבוחר it should be a הפסק? Remember, the Rosh was saying amen to the chazan's bracha because he finished before the chazan. Already we see that the Beis Yosef entertained the possibility that even answering amen to the chazan is a הפסק and therefore he is bothered by the question. He quotes the Rambam, Rabbeinu Yonah, and the Ramban who all say that you are not allowed to be מפסיק between הבוחר and shema.
The Beis Yosef gives 2 answers:
1. There is a fundamental dispute what is the nature of the beracha of הבוחר. The Rambam, Ramban, and Rabbeinu Yonah all hold that it is connected to shema (most probably a bircas hamitzva, the Ramban at the beginning of Berachos says this explicitly) and therefore there is a probnlem of הפסק, while the Rosh holds that it is not connected to shema and therefore there is no problem of הפסק
2. We differentiate between answering amen to your own beracha vs answering amen to the chazan's beracha. The Rambam etc. only prohibited answering amen to your own beracha, answering amen to the chazzan's beracha is not considered a הפסק.
We see explicitly that according to the first answer of the Beis Yosef answering amen to the chazan by הבוחר is a problem of הפסק according to the Rambam etc. The Biur Halacha paskens like this answer in the Beis Yosef and therefore recommends to finish with the chazzan and not answer amen.
However, there is a problem. The Beis Yosef himself seems to go with the second answer at the end when he quotes the Ramah that if you finish before the chazan you do answer amen. He says explicitly that you do answer amen to the chazzan.
If we stopped here the Mishna Berura would be in trouble. However, when we look in Shulchan Aruch we get a different picture. The Beis Yosef (there on the Tur) paskened explicitly that you say the 2 berachos of shema with the chazzan and you don't answer amen (to your own beracha) to either one of them. In Shulchan Aruch (49,4) he states
The Brachot of ‘Yotzer’ and ‘Arvit’ (i.e., the first bracha of Shema), one
should say quietly along with the Sha”tz, and he should not answer ‘amen’ at
the conclusion of “ha-bocher…” because it’s a ‘hefsek’.
If we look carefully we see that he left out the halacha of not answering amen to the first beracha of shema. He starts out talking about the first beracha (that it should be said with the chazzan) and then says you don't answer amen to the second beracha. What about the first beracha? Why didn't he say that you don't answer amen?
This seem to be the basis for the Mishna Berura. The Mishna Berura understood that if the Shulchan Aruch was just taking about the din of not answering your own beracha (as Adderabbi posits), then why single out הבוחר, the same halacha applies to the first beracha as well (which he did say on the Tur). Therefore it must be that the shulchan aruch is telling us a halacha that only applies to הבוחר, namely the din of הפסק (the din of not answering your own beracha is well known and paskened in hilchos berachos so he didn't mention it here). Once we come on to הפסק, then we are back to his first answer in the Beis Yosef where he explicitly said that the problem of הפסק applies even to the beracha of the Chazzan. Therefore the Mishna Berura paskens that according to the shulchan aruch you shouldn't answer amen to הבוחר because of הפסק.
The Gra (as Adderabbi pointed out) clearly disagrees withe the Mishna Berura because he explains the reason for the shulchan aruch as having to do with answering amen to your own beracha.
To summarize, the Mishna Berura is going with the Beis Yosef's first answer in the Tur, that there is a problem of הפסק even by the chazzan, he feels compelled to say this based on the fact that the Shulchan Aruch left out the din of not answering amen by the first beracha.
You can certainly argue on this analysis of the Mishna Berura but it clearly has a basis and is not a mistake.