Yes, you can do that.
Your deck is private. The game does not know how many energy cards you have in it (even if you just put three of them back in with a Super Rod!)
The game also allows you to do as much of an attack as you can, even if you can't do all of it.
Put those two together, and you can find the one energy card, fail the search for the other, and attach the one.