It was a dream.
I Kings 3:15: “Then Solomon awoke — and he realized it had been a dream. He returned to Jerusalem, stood before the ark of the Lord’s covenant and sacrificed burnt offerings and fellowship offerings. Then he gave a feast for all his court.”
What if he did not believe? What if?
But Solomon did believe. He believed a dream, and the dream was reality.