According to its author, https://stackoverflow.com/questions/72928402/referenceerror-jsondata-is-not-defined was at first rejected for containing mostly code. The author then replaced the code with a screenshot of the code, and this went through.
I find code still preferable to a screenshot of code. If users are to be educated about such things, then shouldn't questions containing "mostly screenshots" also be rejected?