Well if Game Freak was absolutely going to make it so that all players are presented to the chance to catch Necrozma before facing the League, putting it in Mt. Lanakila is definitely the most natural way to do it, rather than grabbing the player and saying, “Oh, by the way, we heard that Necrozma landed somewhere out of your way, and you can’t proceed to Mt. Lanakila until you catch it!”
Whether or not all players should be presented with that chance to catch it as part of the story is debatable, but if GF is absolutely going to do it, this is a pretty good way to implement it.
PS, as for the vomiting thing, keep in mind that Necrozma literally just got the Solgaleo / Lunala beaten out of it, then after returning to Earth (somehow; okay yeah, I have no idea how that happened, maybe I’m forgetting something), it fell out of the sky and landed with enough force to create a large impact crater, and is so tired after all this that it’s incapable of moving until you come along and share your Z-Power with it. I think that’s enough to make someone lose their lunch.