I just did a rewatch of all the relevant material, and this was even more baffling to me. Characters and motivations are so thinly-drawn here as to be completely disconnected from the characters we know. I had the same issue with Michael Waldron's writing in Loki. He may be good for creative gags, but I've yet to see that he knows how to write actual character drama or develop them in an arc.
This movie was just...bad. Like, really, really bad. No Way Home is the exception that proves the rule: Marvel has completely lost its way post-Endgame.