C++. SetHideCursorDuringCapture not working.

If I set it during the BeginPlay it works perfectly, but if I try to use it while using it on an input it stops working.

void YourController::BeginPlay()
{
	Super::BeginPlay();
	
	// MOUSE CURSOR //
	FInputModeGameAndUI MouseCursor;
	MouseCursor.SetHideCursorDuringCapture(false);
	ACpp_Controller_ManusDei::SetInputMode(MouseCursor);
    GetWorld()->GetGameViewport()->SetMouseLockMode(EMouseLockMode::DoNotLock);
}

I’m trying to hide the mouse when the player looks around. RTS style. So when the player “Starts” the action it hides the mouse and keeps it in place. And when they “Complete” the action it shows the mouse again.

I tried putting the code exactly into the functions.

void YourController::LookStarted()
{
	// bShowMouseCursor = false;
	FInputModeGameAndUI MouseCursor;
	MouseCursor.SetHideCursorDuringCapture(true);
	ACpp_Controller_ManusDei::SetInputMode(MouseCursor);
	GetWorld()->GetGameViewport()->SetMouseLockMode(EMouseLockMode::DoNotLock);
}
void YourController::LookCompleted()
{
	// bShowMouseCursor = true;
	FInputModeGameAndUI MouseCursor;
	MouseCursor.SetHideCursorDuringCapture(false);
	ACpp_Controller_ManusDei::SetInputMode(MouseCursor);
	GetWorld()->GetGameViewport()->SetMouseLockMode(EMouseLockMode::DoNotLock);
}

I tried to store the FInputModeGameAndUI MouseCursor inside the header and just have it updated. I tried messing around with some other settings but nothing seems to be working. Is this me being stupid or is it a bug?