GEngine->HMDDevice hasn’t been initialized when the constructor is called. While the code could check for that and not crash, it wouldn’t be able to actually set the tracking origin as at that time the HMDDevice is never going to be valid.
Move the call to BeginPlay. At that point GEngine->HMDDevice is correctly initialized so if running on a HMD you will set the tracking origin correctly.
In the constructor for the character (TestProjectCharacter.cpp), add at the end: UHeadMountedDisplayFunctionLibrary::SetTrackingOrigin(EHMDTrackingOrigin::Floor);