The transaction contains the signatures, it doesn’t gather them. A transaction without signatures is different from one with signatures. And one without signatures is simply invalid.
For example, is it possible to create a transaction that spends one of my UTXOs only if M signatures are gathered?
Yes, that is literally what multisignature outputs are. They can only be spent by transactions that provide a sufficient number of signatures.
The transaction author is responsible for gathering the necessary signatures from the co-signers. Without them, there simply isn’t anything valid to send to the network.