State machine changes from "I/O to I" upon pressing "done"

Welcome to the forum @SupportStation

Which state machine node are you using? Possibly node-red-contrib-something.

What do you mean by 'output square'?
Can you create a simple flow just using inject nodes and state machine node to show the problem? If so then export that and paste it here.

See this post for how to post a flow - How to share code or flow json