Throwing a pot of water out looking at the clouds
An Aesop's fable covers much the same idea. Here is how the fable of "The Dog & His Reflection" is rendered in The Æsop for Children (1919):
A Dog, to whom the butcher had thrown a bone, was hurrying home with his prize as fast as he could go. As he crossed a narrow footbridge, he happened to look down and saw himself reflected in the quiet water as if in a mirror. But the greedy Dog thought he saw a rel Dog carrying a bone much bigger than his own.
If he had stopped to think he would have known better. But instead of thinking, he dropped his bone and sprang at the Dog in the river, only to find himself swimming for dear life to reach the shore. At last he managed to scramble out, and as he stood sadly thinking about the good bone he had lost, he realized what a stupid Dog he had been.
The moral given in the book is "It is very foolish to be greedy," but a more apt moral might be "A bone in the mouth is worth much more than an imagined bone in the river." You could refer to this cautionary tale by saying, "It's like the fable of the dog and his reflection."