This past Shabbos I was in a shul where they were counting a child under bar mitzvah for a minyan (even though it is in a Haredi neighborhood but the shul itself is not popular). They refused to find a tenth adult and they were doing krias hatorah. For the first five aliyas, they called up different people, including the rav, but after that I had a feeling that I would be the next aliyah, so I went and hid in the bathroom to avoid a bracha l’vatala (as their minyan is not valid). Did I do the right thing? If they would have called me up, should I simply refuse to go up?
It is quite controversial if it is permitted to count a katan in for a minyan, but it seems that the Rov was relying on the opinions that hold that b’shas hadechak it is permitted, see sources. Therefore, since they were permitted to do what they did, your going out, really ruined it, so I would say that it was not the correct thing to do. If you would have gotten an aliya, R’ Moshe writes that you would have been allowed to say the brachos, see sources.
Magen Avrohom 55- 4,5, Shulchan Aruch Horav 55-5, Livushei Mordechai O:CH 20-1, see Igros Moshe O:CH 2-18 that even if there are other minyonim around, but different people like the minyan that they feel is their type, and by causing the minyan to close may cause some of the people not to daven, therefore it is still considered a shas hadhak.