I think you should try using:
if event is InputEventMouseMotion and Input.is_action_just_pressed("Click") and Input.is_action_just_pressed("ui_A"):
# rest of your code
The difference here is that using is_action_just_pressed
vs is_action_pressed
is that the former will fire only once for the duration of the press, where as the latter will fire every time as long as it is still pressed. So as @Sprowk said, it is firing twice, and the second time the node has already been freed.
Just a note, depending on which input is pressed first, you probably want to use the is_action_just_pressed
on only the second input you expect, because otherwise they would both need to be pressed at exactly the same time, which realistically will never happen. So if you expect the user to hold "ui_A" and then "Click", you likely want:
if event is InputEventMouseMotion and Input.is_action_pressed("ui_A") and Input.is_action_just_pressed("Click") :
# rest of your code