The primary reason for casting a downvote on SO is quality. If the question isn't well written, asks for something unreasonable, lacks information, contains images of code, or links elsewhere for code, it will attract downvotes.
Your first example which is now deleted is somewhat unclear. They did provide code, but they also in passing mentioned ChatGPT and didn't indicate whether any of what they are providing is ChatGPT generated garbage or code they've written themselves. It can be perceived as being code ChatGPT wrote, and as such it'd be quite rude to come to SO and ask us to debug ChatGPT output for them.
For the second question, The original version of the question included an image of code, which is guaranteed to be downvoted and is often quickly closed. Editors shouldn't be expected to transpose that into text.
I've noticed a phenomena lately when answers to what are perceived as bad questions get downvoted. I guess someone has taken it upon themselves to police this site in that way.
This does occur, I think it is wrong, but there's certainly an argument to be made for answers to not useful questions aren't useful.