I follow this, but sadly the internals of Discourse do not support this, it is a very complex change.
Technically a post stores “reply to post_number” it does not store “reply to post_id”, so a fix here would have to involve converting the “off topic” replies to some other structure or amending the post table.