First person camera bugs out when looking straight up or down on a Pawn

So I’m trying to make a Cannon Pawn that you look through the barrel and are able to aim it using the mouse. Currently from the tutorials I’ve found online they suggest something like this

void APlayerCannon::Tick(float DeltaTime)
{
	Super::Tick(DeltaTime);

	//Rotation
	FRotator NewRotation = Camera->GetComponentRotation();
	NewRotation.Yaw += mouseInput.X;
	NewRotation.Pitch = FMath::Clamp(NewRotation.Pitch + mouseInput.Y, -90.0f,  90.0f);
	NewRotation.Roll = 0.0f;
	Camera->SetRelativeRotation(NewRotation);
}

void APlayerCannon::MouseYaw(float axis)
{
	mouseInput.X = axis;
}

void APlayerCannon::MousePitch(float axis)
{
	mouseInput.Y = axis;
}

However when I make the camera look strait down or strait up the camera goes wild and will be facing a different direction usually when I look back up. Every fourm/tutorial I’ve found that may have the solution has to do with the character actor, I’m using a pawn

Try constraining your pitch to -80 and 80 instead of 90