This has been fixed here: FIX: Some solved topics have no answers by nattsw · Pull Request #350 · discourse/discourse-solved · GitHub
Extra note:
When using custom fields, there are very little validations available so marked answers may be dangling, leading to posts that do not exist, or topics pointing to the same post.
We just moved discourse-solved away from using custom fields into proper tables, and there had been some assumptions made like each post should only be an answer to a topic, or a topic with an answer must point to a non-null post. All these assumptions were thrown out of the window