If we take a look at https://codereview.stackexchange.com/help/on-topic we see
To the best of my knowledge, does the code work as intended? if the OP answered this for him/her-self with yes, then the question should be on-topic (if the other questions on the on-topic section could be answered with yes as well).
That beeingbeing said, it looks like the downvote on your answer had been retracted.
but I wonder if it's a convention here to downvote answers to non-working code
If a question is clearly off-topic thethen yes, thats the default behaviour, but such a downvote should always come together with an comment like "Please refuse to answer clearly off-topic questions."
See this meta:https://codereview.meta.stackexchange.com/a/7054/29371