Why are the players only spawning some times?

Do you still have the problem or have you found a solution? If you have the issue did you check if your Player->GetPawn also fails?

Anyway I have found something that works. I have looked at the ShooterGame code and was assuming that the IsSpawnpointPreferred function was working properly there. Then I started wondering what would happen if it was also failing the cast as described earlier. I found that a FailedToSpawnPawn function existed for APlayerController. After overriding as follows, I now get successful spawns everytime (I mean, at least it retries until successfull.)

void AMyPlayerController::FailedToSpawnPawn()
{
	GetWorld()->GetAuthGameMode()->RestartPlayer(this);
}