This gets to a broader question of notional vs formal agreement.
Formal agreement is where verbs agree with the grammatical number, whereas notional agreement is where verbs agree with the semantic number.
Viewing "a [adjective] number of" as the head of a genitive phrase, both British and American English prefer notional agreement (a trend that is even more pronounced without an adjective, to the extent that I'd say using formal agreement there would be incorrect: British, American). This is likely because, as you suggest, "number of" behaves as a determiner instead, with the verb agreeing with the following noun rather than with the singular "number". Other determiners that appear to be the heads of genitive phrases (e.g. "a lot of", "a load of", etc) behave similarly with the verb generally agreeing with the number of the following noun - they exhibit so-called "number transparency".
This preference is weaker in American English (likely due to the general trend towards formal agreement), and was weaker still 200 years ago.
This is likely because 200 years ago grammarians of English got very interested in trying to make the language more "logical". This was the same era that saw prohibitions against double negatives (which more-or-less stuck in many varieties), as well as other prohibitions against slitting infinitives and stranding prepositions that failed to stick in any variety.
One of the prescriptions that was come up with in this era was that collective nouns should only take formal agreement. This is still largely followed in American English, whilst British English allows collective nouns to take either formal or notional agreement with slightly different nuance.
Formal agreement emphasises unified action, whilst notional agreement emphasises the individual components of the collective. If I say "the audience turns around" this suggests they are turning as one, in a co-ordinated way, whilst "the audience turn around" suggests no such cohesion - they are behaving as individuals turning around at slightly different times, speeds, etc.
In all your examples, the norm in either British or American English is to use notional agreement and say "were".
In other examples where you have a collective noun, it depends on whether you are aiming to follow British or American norms and the nuance you are aiming for, with formal agreement using "was" unlikely to be seen as incorrect in either norm, but notional agreement using "were" possibly seeming more natural in a British norm, but incorrect in an American one.