Nope, that's not how it is. They may have bottom drawer music rejected from other projects that they can re-purpose and that might even include a suitable theme. Actually all media composers have big bottom drawers full to bursting of rejected music however generally speaking, each score has its own unique set of issues and needs to be written bespoke and in collaboration the director, producer etc.Can we say that John Williams, Hans Zimmer, Alan Menken, Thomas Newman, Ennio Morricone, Alan Silvestri and others COMPOSE music for a general purpose and then they ARRANGE it to fit the scenes of the film?
While they are COMPOSING the music they are already thinking about how it would sound outside of the film (because they want to sell albums and tickets for concerts), although when they arrange it they have to think about the images of the film.
Writing music to film is also instinctual, responding to the emotional and practical needs of any particular moment in the film with the appropriate mood, so clairvoyance is out too. The bottom drawer is useful if a composer is lucky, but not the answer to the puzzle a composer is beset with in writing a score. As part of solving that puzzle, composers will also strive to find a 'soundworld' for a score and that can only be done with the film and brief in front of them and after much thought and experimentation.
The only scenario where music is pre-written to a certain emotion or mood is in Library Tracks and there is a huge industry supplying such tracks to media. These can be used by editors as temps and some might even make it to the final cut but very, very rarely does this happen.
Nice try though HZ....