Someone ask how to handle metagaming players.
OOC To the players I tell them sometimes you will come across things you can’t beat.
When the player is still clueless. I give the example, if I mention there is a large red dragon flying overhead and you are first level. This does not mean dragon hunting today. It is either atmosphere, or a game hook when the party is higher levels.
If the goober player still wants to go dragon hunting at first level, I let the pc do so. Red dragons love snacking on low calorie adventures.
Someone mention the hobby is shrinking due to DMs not catering to every play style at that sit down at the table. I say good. I am too old to deal with problem children. If my dm style does not fit your gaming style hit the door. Once I learn this rule, I have dm and played less. But I have a lot more joy while gaming. Even back in 80s, I wondered where the rule of D&D is SPECIAL. So I and the other gamers have put up with you being a problem because you are a FELLOW gamer.
To the OP. Since it appears you tired beforehand to change this player’s game style to match the gaming group style and got tired of it not working in game. You did metagame in anger. But, and I have seen this before, the player was able to get the pcs to willing follow him into the trap.
To show other here, the type of Dm I am. Back in the early days of 3E, some company was giving out free modules um adventures. I got my hand on one. The quest is the party has to get a staff recharged by having got hit by a Blue/Bronze Dragon lightning bolt weapon. The hook is the dragon will do so if the party will go in to subbasement and clean out the monsters (which are the adventure) because the dragon can’t fit down them. The metagaming player thought the adventure was to take out the dragon. In game I hinted bad idea. Some of the other gamers who knew my style took the hint. And told the player in game bad idea. The goober player still did not take the hint.
I called OFF BOARD, which at my table was me stopping the game and telling the people at the table the truth. OCC I told Bob the dragon is level twenty. And called a break.
After the break, the pc still wanted to kill the dragon. The problem player said, “ Charge my fellows”. And rolled init. I rolled init. He won. Swung on missed. The dragon Claw, Claw, Bite. GLUMP!.
Dragon now tick off spoke to the remaining dinner, “And what are you going to?”
Player in character slowly raise his hand, “Please kind sir, he was the village idiot that we could not keep from tagging along. May I ask how he tasted?”
Dragon, “ a little raw and undone. Not well aged.”
The problem player did get the clue, that I would kill a PC. And that if player got stupid again and his pc died, the party would not raise his pc. PS iirc the problem player was the seven year old son of the person who asked how he tasted.