To prevent this know what champ you want to play before you enter queue or while you are in queue, then during that time put your runes together in a cookie cutter way that lets you easily change something up if you need for going against a certain matchup.
Take nasus for example: because I didn’t buy any extra rune pages I only have two. I set up both of them around nasus. A Grasp one for going against tough melee matchups that can bully me early. And a conq page for going against a mainly tank team (for example: cho top, galio mid and something like braum supp). After locking in my champ I will edit either one more for personal choices or to help against the enemy team. And because the runes I chose are also mainly applied to other champs, I don’t need to edit them that much if I don’t choose nasus. And that way I don’t risk having the wrong runes when I load into the game.
When you go into a game, or when you are setting up your runes before queue, make them generalized towards a playstyle that your intended pick plays. That way if you need to change it up for another champ you don’t need to completely redo the page.