UE5.1 How to Update the Default GameMode.cpp PlayerClass?

When creating a new UE5.1 C++ Games project the engine setup a ProjectNameGameMode.cpp and ProjectNameGameMode.h file inside Source/ProjectName, with links to ThirdPerson/Blueprints/BP_ThirdPersonCharacter.uasset and BP_ThirdPersonGameMode.uasset.

Even after manually updating the path inside ProjectNameGameMode.cpp to the actual PlayerClass and deleting the .VS folder the engine shows an error message with the old path.

CDO-Constructor-Failed-to-Find-01

Are the UE5.1 source gamemode files required?
How can we update the source gamemode PlayerClass?