But since I don’t know if it is incompatible to avoid future problems, I have replaced it with a UActorComponent just in case. And it seems to work fine too.
But if anyone knows if UActorComponent cause problems with AGameMode please let me know.
While there seems to be nothing in place that prevents you from adding a UGameStateComponent to an AGameMode you should probably avoid doing that. If you do and then call GetGameMode or GetGameStateChecked, the CastChecked will fail since the owner would not be an AGameState which is expected here.
You can directly use UActorComponent though or write your own UGameModeComponent similar to how UGameStateComponent works.