Excuse me for duplicating the topic - I didn’t know how to restore the previous one, but I’ve actually hit the issue here, hoping you could help solving it.
I had this same exact issue when trying to pass that stage with C#. It took a lot of trial and error to get past it. What I found was that Console.SetCursorPosition doesn’t play well with the tester. Any code that I had that used that was doomed to fail. To clear existing text from the screen I had to write a series of “\b \b” to the screen, which is a backspace-space-backspace combination.
Console.Write("\b \b");
While the code is ugly, it passes the tests. Good Luck!