The flag declination was absolutely appropriate.
This was posted as an answer, but it does not attempt to answer the
question. It should possibly be an edit, a comment, another question,
or deleted altogether
That is the flag reason you chose, and it's incorrect. The answer does attempt to answer the question. It may not be a high-quality answer, but ...
I declined the flag, precisely because it is on-topic here.
Typically if a post is cross-posted to multiple sites, it should be closed on the sites on which it is not on-topic. I'm a bit surprised that it wasn't closed on SO; that's not a topic I usually expect to see left open there. (But the presence of the bounty prevents people from voting to close it.)
It is a cross-post, but it's topical here. We could flag the SO post as belongs on us for just as good reason (even though it's bountied over there).
We do discourage cross-posting, preferring to pick a site and merge. But... not always.