I tried. The code appears as follows. Same result.
else:
state.customcursor = "res://files/buttons/kursor1.png"
if !state.mansionupgrades.has("farmmana"):
state.mansionupgrades.farmmana = 0
gameloaded = true