99.99999% of the time a machine is going to do exactly what it is told to do. You don't give any history behind your story. Is this a brand new to you machine and this is your first run? Or has this machine been running fine on other jobs but not now on this one?
I bet you messed up somewhere when setting tool or work offsets. Happens to all of us. Machines don't typically move randomly. They're not smart enough for that. They simply do what they're told to do. Nothing else.