UE4 crashes when I make a particular change in C++ code

Hi,

I am new to UE4 programming. I was following the example in Variables Timers and Event section
( Quick Start Guide to Variables Timers and Events in Unreal Engine CPP | Unreal Engine 5.3 Documentation).

UE4crashes when I move below two lines from BeginPlay() to the constructor.

UpdateTimerDisplay();

GetWorldTimerManager().SetTimer(CountdownTimerHandle, this, &ACountdown::AdvanceTimer, 1.0f, true);

When I move these two lines back to BeginPlay() in visual studio editor and build VC++ solution, then it starts working fine again.

Is it a bug? if not, Can somebody explain the reason behind this crash?

Regards,