You may need a therapist. He may be struggling at school. Daydreaming, also known as escaping your reality, is a sign of disassociation. He may not have an issue of lying, he may have an underlying issue that manifests with lying as a symptom.
On a less serious note, he may just need to be praised for his story telling skills and need to learn how to use it appropriately. You need to be a safe place for him to be truthful so that he is encouraged to tell the truth.
My son is doing that too. He just told me he had a bad day. He spent the day outside. I asked where-playground? He said no- middle of the street. I said wow, did you see cars? Nope! Just flying pigs who pooped all over the cars in the parking lot 🤣
How about if you we somewhere with him, then ask him to tell his dad or grandparents about it. Would the story come out as it happened, or would he exaggerate somewhat with the truth? Also I’m wondering if he’s crying out for some extra attention and care from you, like could he be jealous of a younger sibling or something? See if extra affection and attention and one to one time with him helps this to happen less. There could be many reasons why he makes things up.
https://nurturedfirst.com/toddler/child-lying-solutions/?fbclid=PAY2xjawIZg5BleHRuA2FlbQIxMAABpg7PVu3mU3Zl8X-gYjW7D0RBHAs1bZeEgRlJPK02IFq19qMmFNqKrp76qA_aem_wNOaVw7fFJcIqZrqitI3Bw This is a good blog post about it, and i love her Instagram page for all kinds of good parenting tips
@Julia going off your comment, I would say to ask questions/details about the “situation” just to make extra sure it didn’t happen. You never know if the teacher really didn’t throw the shoe back at him 🤷🏻♀️
My daughter did the same thing (she’s almost 4). I bought her a few books Lying up a storm and My magical choices and have been reading them to her and providing her real examples. I haven’t noticed her intentionally lying or even exaggerating since then. I also have done positive encouragement and congratulated her anytime she told the truth or admitted to doing something wrong. Best of luck!