Camra Math problem with Custom Gravity

Hello everyone,

im new to unreal engine and struggeling a bit with the vector math when using custom gravity. I am using this tutorials code: Custom Gravity in UE 5.4 | Tutorial to calculate the camera rotation when gravity changes. I commented out the block that makes the camera automatically compensate for gravity rotation. instead i want to allow a full 360 degree camera in my case. the issue is that the math of this setup does not work out when my pitch goes >= ±90deg. From my understanding the cause of this is the fact that to calculate the difference between the camera position and the current gravity direction the code uses FindBetweenNormals.

FQuat GravityRotation = FQuat::FindBetweenNormals(GravityDirection, FVector::DownVector);
return (GravityRotation * Rotation.Quaternion()).Rotator();

For the purpose of this function a pitch of 45deg or 135deg should result in the same offset since it both just gets compared as a vector to the gravity direction vector. So if i look at a angle of 45deg, then change my gravity by 90deg the camera calculates the new position as a frontal view of my character instead of a 135deg pitch.
So the actual camera vector doesnt change but it rotates around that vector.
While i do now understand the issue, i have honestly no clue how to do something about it. So im hoping for your help and hope i made my issue understandable ^^ Thank you very much in advance!