Crash by playing in GameMode with PlayerController (C++)

If so, your cm variable is null, and you’re assuming it’s not (line 28 again: cm->GetCameraLocation()).

In line 14, you’re trying to cast APlayerController to APlayerCameraManager which is a no-go.
Change that line to:

cm = PlayerCameraManager;

Or you can simply use PlayerCameraManager instead of cm variable.