The first story
In Vedic literature incarnation as Hayagriva is attributed not to Visnu, but to Yajna. But the Taittiriya aranyaka depicts Yajna as a protoform of Visnu. The inference that may be drawn from the above is that the root of the Hayagriva story detailed in Vedic and Puranic literature is one and the same.
About the Hayagriva incarnation the Pancavimsa-brahmana contains the following story.
Agni, Indra, Vayu and Yajna (Visnu) once began a yajna on the understanding that the havirbhaga obtained from it should be divided among all the Devas. But, in violation of the agreement, Yajna left the place carrying away the whole Yajnabhaga with him, and he drove back the Devas who followed him with the help of the bow presented to him by Devi.
Finally the Devas got the string of the bow bitten off by termites and the bow which got straightened up cut off Yajna’s head. Yajna then apologized for his offence and then the devas got the Asvinidevas to fix the head of a horse to the trunk of Yajna.
(Pancavimsabrahmana 7, 5, 6; Taittiriya aranyaka 5, 1; Taittiriya Samhita, 4-9, 1).
The second story
2) In Puranic literature. The above story is told in Skanda Purana with slight modifications as follows :-
Once Brahma and other Devatas conducted a test as to which one amongst them was the greatest, and when it became evident that Mahavisnu was, in every respect, superior to all the others.
Brahma cursed that Visnu should lose his head. Visnu, who got thus bereft of his head attended a yajna conducted by the Devas with the head of a horse attached to his trunk.
After the yajna was over he went to dharmaranya and did tapas there and by the blessings of Siva got back his former head instead of that of the horse.
The third story
The Lord appeared as the Hayagriva incarnation in a sacrifice performed by Brahma. He is the personified sacrifices, and the hue of His body is golden. He is the personified Vedas as well, and the Supersoul of all demigods. When He breathed, all the sweet sounds of the Vedic hymns came out of His nostrils.
At the end of each kalpa, when the demon Ajana steals the Vedic knowledge, Lord Hayagriva appears and preserves it. Then He delivers it to Lord Brahma
The Lord appeared as Hayagriva, with the head of a horse. He killed two demons known as Madhu and Kaitabha, who were full of the modes of passion and ignorance. For this reason, all the great saints accept his Forms as transcendental, untinged by material qualities.
(These are just notes. In my next book you find the complete stories)

Giridhar Kirthik H
Hare Krishna Prabhu
Yes there are n number of stories in the Puranas wrt not only the incarnation of Hayagriva, but also wrt other Devatas etc which appears to be very much contradictory to each other, bewildering as well as deluding. Even if u see the birth story of Ganesha, in one purana you’ll find that he was born from the body mud of Parvathi, and in another purana it’s told that he was born as the son of both Shiva and Parvati in the womb of Parvathi after 9 months etc etc. So each story may appear to be contradictory to each other. Lord Vyasadeva has purposefully done that so that not everybody except the wise satvik devotees should be able to understand the inner meaning of Puranas. Because the methodology of understanding Puranas is itself a very different topic. Sriman Madhvacharya has explained the proper method as to how we can understand the inner meaning of the Puranas, which appears to be contradictory and also against the proper Vaishnava Siddhanta/ Vishnu/Krishna’s supremacy. He says that there are 3 broad interpretations when it comes to understanding Puranas. The first one is called Samadhi Bhasha, second one is called as Darshana Bhasha, third one is called as Guhya bhasha.
Samadhi bhasha means understanding an incident or story on the basis of proper Vedic conclusion or Siddhanta
Darshana Bhasha means understanding an incident or story as it is, like how it’s written or seen
Guhya bhasha means interpreting a hidden meaning
For example. It’s told that when bhishma shot arrows on Krishna, it pierced him and blood was oozing. That is Darshana Bhasha. But how ?. We know tht his body is transcendental. How can blood come. Now we can interpret into samadhi bhasha that it’s transcendental body, but to delude asuras he did like that
Now when it comes to termite eating now of Yajna paramatma and cutting his head. This is not to be taken as a real happened incident. Here Yajna paramatma represents Sattva guna,
Bow means Rajo guna (fighting), termite means Tamo guna, insect. So inorder to come to shuddha sattva, we need to use rajo guna and tamo guna bow and termite, and fight to establish hayagriva or jnana. This is not a historical incident. But philosophical
Similarly when Ganesha came out of Parvathi’s body mud, it’s not a historical incident. Shiva and Parvati are the predominating deities of Akasha or ether. Parvati’s body mud means Tamasic ahankara. Mud means Tamo guna, fire is sattva, and water is rajas. So here Parvati body mud means from Akasha devata’s Tamasic ahankara, ganesha was born. So he’s son of both Shiva and Parvati, not Parvathi alone
So, likewise we need to interpret all Puranas properly by understanding all 3 types of bhashas