Don’t know what I did wrong?

I made several mistakes in assigning companions and got a lot of them killed but what did I do wrong that caused myself and my two companions to die at the very end after the last fight?

I had just come to terms with everyone else sacrificing themselves and kept my romance partner and my best friend with me because I thought we would be the final three survivors but then we all died too? I don’t understand what choice I made led to this and now I’m sad lol.