Izanami is how you do a good twist. They basically tell you THIS SCENE IS IMPORTANT when you first start the game with the controller rumbling and what happens to the MC getting sick afterwords and then dreaming about being in the final dungeon and trying to fight Izanami but Yu can't see anything because of the flog. You forget about it though because the plot changes from that point on and becomes about the murders and trying to find that truth. When you learn about Izanami at the school trip its clearly setting up a 'continuation' of that story with Yu's Persona being Izanagi. It's setting up the actual endgame at about 2/3rds through the story just without directly spelling everything out for you since the murder mystery is still the primary focus of the story right then.
The biggest theme of Persona 4 is finding 'truth' this is why the ending battle scene is so epic. Yu removes his glasses because he doesn't need them anymore because he sees the truth, he can see through the fog, through Izanami and her devilish form. It's the entire point of the entire game. Without Izanami we'd be left with so many questions, where did the midnight channel come from, where did the Persona powers come from, why didn't Yu have to awaken a Persona from a shadow, ect. By seeing the truth Yu fully understands everything that has happened and with that known he can truly say goodbye to his friends and new family at Inaba, nothing is left nagging him that isn't explained.
Also just want to mention this... Izanami as the gas station attendant is around the game on rainy days. She is a NPC that you can interact with on those days so she doesn't just disappear after meeting Yu, shes literally there the whole game you just don't know who she really is then.
I'll give you that the voice actor being changed for Igor to symbolize that its not Igor is a GREAT twist but not the 'god' thats behind him. You talk about how Izanami wasn't foreshadowed well but what about Yaldabaoth whose name I had to look up because I didn't remember it because he has NO significance in the story until the 'reveal' theres no foreshadowing or build up hes just suddenly the mastermind and is evil for the sake of being evil, Izanami we already knew her backstory from the school trip so her desire made sense. Yaldabaoth doesn't have anything like this hes just kinda there because they wanted to repeat as much of the previous Persona's endgames as possible when they didn't need to. You said Izanami being in P4 would've made the game better but I can argue the exact same thing about Yaldabaoth because outside of the Igor twist he brings nothing to the game besides a final endgame sequence that is going out of its way to try and be as epic as possible when it doesn't need to be.
Persona 5 has a big problem with trying to constantly outdo itself by have more and more grandiose events. Each Palace is bigger then the last as well as the target the group goes after. You go from a school teacher to a con artist, to a mob boss, to a CEO, to the soon to be prime minister, oh and then a god because how you do you surpass the leader of a country? We had to keep going to something more epic right? Oh the entire world is being taken away and then Joker has to summon a mecha sized Persona to defeat the final boss because we need to be as grandiose as possible right? For 'Phantom Thieves' whose whole goal the entire game has been about about doing everything secretively with a cover mechanic that literally makes you invisible to enemies and the final sequence is basically summoning a Gundam sized Persona in space to take out the god of control? Really?
*ahem* I'm getting a bit off topic now but yeah, Persona 5 has a lot of fucking issues as I've stated multiple times in this thread already. I'm not going to call Persona 4 perfect either, elements of it certainly haven't aged well but if you don't understand why Izanami works so well then I highly suggest you read through:
http://megamitensei.wikia.com/wiki/Izanami to really dive in to her ultimate role in the game. I think the biggest difference between the two is that Izanami generally acts in a 'god' like role in Persona 4 never truly being evil where as Yaldabaoth acts more like an evil super villain plotting and taking over the velvet room and what not instead of acting like a god in any way. I don't think his plan was bad but for the being behind it all to be a god that is never once properly foreshadowed? Yeah it never really seemed well thought out to me.