Basic Light rotation not working in viewport/preview, yet works in standalone

I have an issue where I set the directional light rotation on Tick. Yet in the play window (Play > New Editor Window) the light does not change, but when I switch to the viewport and I change the camera position (while still playing in editor window), the light jumps to current rotation . The light is set to movable. When I run the standalone game (Play > Standalone Game) the rotation works as expected.

I get the light in BeginPlay:

for (TObjectIterator<ADirectionalLight> Itr; Itr; ++Itr) {
   if (Itr->GetName().Equals("SunLight")) {
        SunLightRef = *Itr;
        break;
    }
}

and then on Tick i do:

SunLightRef->SetActorRelativeRotation(CurrentSunRotation);

Specs:
Windows 10
i7-4790k 4.00GHz
32Gb Ram
AMD R9 390x

I think your object iterator is causing a problem, you can try this code :
This code is in the BeginPlay

TArray<AActor*> FoundLights;
	UGameplayStatics::GetAllActorsOfClass(GetWorld(), ADirectionalLight::StaticClass(), FoundLights);

	for (AActor* TActor : FoundLights)
	{
		if (TActor->GetName().Equals("SunLight"))
		{
			MySunLight = Cast<ADirectionalLight>(FoundLights[0]);
			break;
		}
	}

and this one in your tick :

if (IsValid(MySunLight))
	{
		FRotator MyCurrentRot = MySunLight->GetActorRotation();
		MySunLight->SetActorRelativeRotation(CurrentSunRotation);
	}

That worked thank you!