My hypothesis is that if there is no other morpheme (so only affixes and finales), the preposition plays this role. But whenever there is another morpheme, it is considered a prefix. Is this correct?
Well, not really. For example malantaŭ has two morphemes and it still is a preposition.
Concepts like morpheme, preposition or affix were originally created to analize a specific group of languages. They were then expanded to (try to) describe other languages, with various degrees of success, mainly because some of those categories and concepts might overlap or disappear when moved away from the group of languages they were originally meant for.
If you are trying to understand Esperanto from a grammatical point of view, it might be a good idea to go the other way around; read an easy Esperanto grammatical explanation in Esperanto and then, if needed, try to match the categories presented there to the most generally used concepts.
The "Plena manlibro de Esperanta gramatiko" is perfect for that. You will find that there are no "prepositions" (here's why), but "rolvortetoj" and that it really makes sense in the context of the language and, most importantly, that it helps understand its underlying structure.