In Journey To the West, Wukong reached enlightenment and achieved the title "Victorious Fighting" Buddha (Mahayana Buddhism) or Arhat (Savaka Buddha) in Theravada Buddhism. All his defilements already disappeared completely; hatred, greed,ego, desire.
So, what we see in Black Myth opening scene, I think Wukong was acting very well- to confront and challenge Celestial Soldiers and Gods, because it's one of his scenario with Erlang for his 'suicide plan'.
In Dhamma, the Enlightened One, is able to decide when he'd Parinibbana (dies) and not reincarnate again in this 31 realms (Absolute Freedom) but in Wukong's case, how can he die? In my opinion, First, there's no God nor entity could defeat him.
Second, this is the important thing related to Buddha Dhamma teaching, Wukong won't let anyone kill him because killing an Arhat (Savaka Buddha) is one of Five Greatest Akusala Kamma (worst karma)
Wukong as "The Victorious Fighting Buddha' or Arhat (Savaka Buddha) definitely has pure heart, no defilements. If you watch carefully, he didn't attacked the soldiers at all, instead he kept blocking their attacks. In the end,he pulled the Spear that Erlang was holding and stab himself.













