obviously its fiction.
its just a story. theres a deeper moral of love that shiva has for his wife and what she wants and loves.
this is a story of how sri ganesh came to be.
his image and other stories make him a profound deity to follow.
his is most commonly known as the deity to worship to remove obstacles.
read more stories omega if you wannna get a better picture of Ganesha.