Experienced this issue a couple of days ago in UE5.1. It worked fine with a controller, but not with a keyboard and mouse. When using a mouse, it gave unstable input values, so I clamped those values to -0.9f and 0.9f before passing them on to the “AddControllerYawInput” and “AddControllerPitchInput” functions. Then, in the Project Settings, I turned on “Smooth frame rate” and set the “Smoothed frame rate range” to a minimum value of 30 and a maximum value of 200. That fixed the issue for me.
If you feel that the camera turns too slowly, you can multiply the clamped values by a larger number and also delta time.
Hope it helps!