Ummm, I don't know about taking taxis in Ayerbe. It doesn't sound right...
All the times I went to the castle it was by car and it seems that's the way most people do it unless you take an organized excursion and then they'll take you by bus.
The bus company Alosa serves most of the Pirineos and they have a couple buses a day from Huesca to Ayerbe. The buses stop at Loarre but I'm guessing is the town, not the castle. Here is the website -in Spanish I'm afraid-
http://www.alosa.es/ Or maybe you can contact somebody at the castle directly, this is their website
http://www.castillodeloarre.com/ Good luck and enjoy the castle, it's beautiful!! But bundle up you'll be cold in December.
Chus
_________________________
www.sandboxceos.comTravel products for children and their families that foster independence, organization, creativity and FUN!