Calling your ex-boyfriend's name in your dream may indicate that you still care about his feelings or haven't completely solved them, and there are still unfinished things or feelings left in your subconscious. It may also mean that you are dealing with the pain and loss after breaking up.
The solution to this nightmare can be to try to solve the inner feelings in various ways, such as positive psychological adjustment, communication with relatives and friends, and participation in psychological counseling. In addition, relaxed sleeping environment, regular work and rest habits and happy mood also help to reduce the occurrence of nightmares.
In a word, dreams are very personal and subjective experiences, so there is no exact metaphysical explanation. If you think this problem is bothering you, I suggest you consult a psychologist and get a more specific and personalized solution.