For the proper ruling, let's check the past interps archive.
2004-05 NFHS Basketball Rules Interpretations
SITUATION 3: A1 is fouled by B2 and is awarded two free throws. The foul is B2’s fifth foul. The new trail official reports the fifth foul to Team B’s coach. Before a substitute is made, the lead official incorrectly permits A1 to attempt the first free throw. The officials realize the error and huddle to discuss the situation. RULING: The result of the first attempt shall stand. Team B’s head coach shall be notified of B2’s disqualification. Once B2 has been replaced, A1 shall attempt the second free throw. COMMENT: This is an official’s error and not a correctable-error situation according to Rule 2-10. (2-8-3, 4-14-1, 6-1-2c, 10-5-1d)
So you got the ruling right on the mess. Now as for what you could have done better.
1. As soon as the scorer notifies you of the 5th foul on that player,
IMMEDIATELY TURN AND TELL YOUR PARTNER!!! Do that BEFORE going to the coach or starting the clock for the replacement period. That should prevent your partner from carrying on with the game as usual.
2. After the 1st FT was attempted, and you conferred with your partner, I would have had the Trail official, or maybe the R, bring both coaches together at the table and inform them of what happened, what the ruling is, and how things will proceed from that point. This extra communication is what I recommend instead of both of you simply announcing 1 FT and putting a finger in the air. By talking to the coaches you ensure that they are clearly informed. They may not like it, and might complain a bit, but that's what happens when there is an administration mistake. You deal with it and move on. I've found that you can handle just about anything, if you communicate it well.