LookAtRotation, how to avoid gymbal lock for component

Hello.

I can’t get looking at a location to work properly.
Trying to get quaternions from vector difference always failed in different ways, the closest thing that worked was

look_at_vector = (target_loc - WeaponParticleSystem->GetComponentLocation()).Rotation(); look_at_vector.Roll = MainBody->GetComponentRotation().Roll; WeaponCube->SetWorldRotation( look_at_vector );

but the gimbal lock (?) makes it not work, I think.
The closer it is to looking fully downward or upward, the more it rotates to the side, then flips over sideways.
Using MakeFromX makes it flip vertically, which is still not good.
Trying to turn the difference of target and source vector into a quaternion rotation just didn’t give meaningful anything.
This is not for a player, but for a subcomponent.

Been stuck on this for about 3-4 days.