It doesn't influence the acceptance of my code. Just find it out incidentally when testing. Could someone explain why? :)
The task starts with "A robot is located at the top-left corner". Your grid doesn't have a top-left corner. Thus your input is invalid and it's a case of garbage in, garbage out.