It might be because of this line that it needs the “decides”, which basically means it could fail, so check first. Try this:
if (NewCanvas := MakeCanvas()):
myPlayerUI.AddWidget(NewCanvas, player_ui_slot{InputMode := ui_input_mode.All})
set Canvas = option{NewCanvas}