After you have generated the g-code, delete the entire header block. Otherwise, the g-code won't work!
The Ultimaker S-line firmware will check the firmware version and say that G-code file cannot be printed because it contains an “error”. (it has something to do with the numbers in the header block)
inspiration: https://ansonliu.com/2024/04/ultimaker-s3-s5-s7-prusaslicer-profile/
The author marked this model as their own original creation.