It is a strange issue, because the correct Discourse topic is being displayed in the Discourse metabox on your edit page. This means that the value of the discourse_permalink post metadata is correctly set.
Can you try unlinking and a post to Discourse and then relinking it to its Discourse topic? This will delete and then reset all Discourse metadata that is associated with the post. I don’t expect this to solve the issue, but it would be good to rule it out.
If this doesn’t solve the problem, can you post, or PM me, some details about the template customizations you have on the site?