An error using show mouse cursor and set input mode ui only

Maybe because I used

Event endplay - destroy(custom function)

Destory - create widget(deadscreen(the name of the widget in which the error happened) - add to viewport