The Buddha said that there is no self, ego, Atman, soul (all are synonymous for the purposes of this discussion).
The problem here is this teaching was not meant for all beings. It was meant for those who are heavily attached to a permanent self. Those who are strongly attached to their life. It is an attempt to weaken their attachment.
The reality is there is a self but it is NOT permanent and it is in a constant state of change. Since it constantly changes and is not permanent why do people hold to the idea that it remains constant and persistent?
The reality is if you are still under the effects of the bull mind then you are attached to the self. The cure is to reach samadhi and experience the non-existent nature that there is no self nor other and there is another level where even this concept of no self or other has completely vanished. Not until you experience this state can you fully realize what the non-existent of self means that the Buddha was referring.
It is just an attempt to awaken the attached mind to ultimate reality.