Gilgamesh seems to be a kind of cousin of Heracles, who killed Antaeus (in Morocco) and Geryon (in Spain).
Gilgamesh is Heracles.
Gilgamesh is Odysseus.
It's the same narrative in different contexts. The same as the "myth" of the Flood which is also contained in the Epic along with correspondences to Samson, Delilah, Jacob, Esau, Noah, John the Baptist, Jesus.
Their exploits are fabulous in the true sense of the word, but when one drills down into the texts they cannot be factual.
The purpose of the "myth" is to focus on the human condition and why we are what we are, and how to ascend to godship.