I do agree that ultimate responsibility for this rests with the coach/team. It's their fault for a lack of organization which resulted in them having too many out there, but I also believe that the officials screwed up by putting the ball in play without accurately counting or maybe without counting at all.
We both know that the officials manual mentions the officials seeing five players from each team on the court.