Unbalanced three phase system with unbalanced phase to phase voltages
The commented and suspected conflict exists. You have probably a wrong assumption on how the dual presestations of U12 should be interpreted. Check it!

To avoid the conflict one of the interline voltages must not be given or it should be right, too. Assuming that there is no given value for U31 the conflict disappears. But the dual presentation for U12? That also is a conflict. Check if one U12 really should be the given U1. Namely one of the line voltages can be given, if two interline voltages are given. The first U12 = 400V is the most probable candidate to be changed to U1=400V because it has the angle =0 or it's a RMS scalar value.