Should the signature be prefix or postfix to the message in the sign-then-encrypt scheme? Let's assume we have a message $M$ and it's signature $S$ and that $|$ is
the concatenation operator.

Should we encrypt $S|M$ or $M|S$?

Does it even matter?
Secure encryption does not care about how the data is ordered.

With the typical single use symmetric keys that hybrid encryption uses, I cannot think of a way it could matter one way or the other. With key reuse (if you used symmetric encryption on signed data), there are some cases where having the "randomness" from the signature in the first blocks might help, but that would mostly be papering over security holes.

In practice, having it at the end may be preferable if it allows for a streaming interface where the data gets encrypted and maybe even sent before all data is ready to be signed.