Chapter 5:
The animated sequence is a bit confusing because it constantly hops between three eras (sometimes within the same scene): Ox King/Wukong before, during, and after the Journey to the West (according to Black Myth). Also confusing because Ox King's immortal and doesn't actually die, so the severed head is misleading.
Ox King is written like this tragic character who continuously makes the wrong choice and suffers for it.
BEFORE the journey, Wukong and Ox King were best-bro "demons" on the non-righteous side. Think of them like extremist libertarians who embrace their vices and have an attitude like "As demons, we gotta stick together, and if nobody will give us respect anyways, we'll do whatever we please and take it for ourselves". It sounds like in this version of the story, Ox King assists Wukong in his FIRST temper tantrum against the heavens. While Wukong was punished with the journey, apparently Ox King was punished by being forced into conceiving Red Boy.
DURING the journey, the protagonists fight/defeat Red Boy, resulting in him becoming a servant of the celestial court. Ox King and Princess Iron Fan (married, with tons of family drama due to Ox King sleeping around) resent them for it and refuse to let them borrow her iron fan, which they need to cross a mountain that's on fire. Due to this drama, they engage in escalating deceptions involving tricking them with fake fans and using transformations to pose as Bull King/Bajie and trick the other party into giving the fan. Wukong ends up taking it by force, and Bajie kills his concubine Fox guai, so they end on very bad terms. Tension between Wukong and Ox King stems from Wukong flipping to the righteous side over the course of the Journey, which feels like a betrayal to him. The scene with the severed head is either how the group (with help from the heavens) defeated the Ox King to take the fan, or a tantrum he throws after that, which gets him subdued.
AFTER the journey, it appears that Ox King either took Wukong's advice to heart and became a servant to the heavens, and instead of assisting Wukong in his SECOND temper tantrum, instead assists in taking him down (along with the previous chapter bosses, who are each rewarded with Wukong's five senses). But as Wukong tells him in his (sort of?) dying breath, as a Yaoguai, they'll always consider them criminals no matter what they do for them (furthering Ox King's tragic existence).
This was also the main theme of Chapter 2's animated sequence, and why Bajie shows no remorse in killing the concubine (even though initially, Bajie could be considered a Yaoguai as well, since he's on the righteous side when tasked with the Journey, he treats Yaoguais he encounters like a disposable evil not worth considering).
Edit: There's a famous Chinese idiom that goes something like "When you're a child, you're Wukong, an undisciplined/uncaring ball of reckless energy that thinks nothing can stop you, when you're a teenager, you become Bazie, an escapist slave to your impulses, distractions, and desires, then when you grow up and start a family, you become Ox King, a defeated shell of a person living in fear/indecision, worrying about every little outcome and making the wrong choices."