I guess, the Manual mode of Test Case editor in Katalon Studio is built on top of the Groovy language’s “Abstract Syntax Tree Transformation” feature.
The Manual mode reads the Groovy source of a Test Case to compile it to generate an instance of Abstract Syntax Tree and keep it in memory.
When you modify the test case in the manual mode, the editor transforms the AST instance to store your instructions.
At this stage, the test case editor no longer remembers how the original Groovy source was coded.
When you switch the editor from the manual mode to the script mode, Katalon Studio serializes the AST instance to a Groovy source code. In other words, the test case code is regenerated.
The processing of “from AST to Groovy source serialization” is designed on its own. The serialization processing is not designed to preserve any comments which were originally there in the source. It formats all the String literals as it thinks appropriate. Therefore in the script mode you will find the source which is quite different from what you had previously.
… I guess as such, but I am not sure. I have never seen the source code of the Katalon Studio GUI (an Eclipse-based SWT app) because it is not open sourced. Just I have ever seen a symbol "AST" somewhere in a stacktrace message years ago, that is the only reasoning of my guess.
Once I wrote that I think that Katalon team would NEVER address this fossil bug.
Still I don’t think they would dare to change the current design of Test Case Editor on top of the “AST” because it is too fundamental to re-invent.