Looking for a pie's nest (French). Looking for something you are not likely to find. (See below.)
He is in the pie's nest (French). In a fix, in great doubt, in a quandary. The pie places her nest out of reach, and fortifies it with thorny sticks, leaving only a small aperture just large enough to admit her body. She generally sits with her head towards the hole, watching against intruders.
“Je m'en vay chercher un grand peut-estre. II est au nid de la pie.” —Rabclais.
Source: Dictionary of Phrase and Fable, E. Cobham Brewer, 1894