figment of (one's)/the imagination
An experience that initially is thought to be real but is actually imagined. I thought I heard the sound of my front door opening last night but it turned out to be a figment of my imagination.
a figment of somebody’s imagiˈnation
something which somebody only imagines: Doctor, are you suggesting the pain is a figment of my imagination?