Thanks Jose for the quick and helpful response. I forgot to say in my original post what a useful plugin this is and it’s working well for me. So thanks for your hard work.
Yoast Duplicate Post does allow metadata to be filtered with a comma separated list of exclusions, so your solution of setting the filter works nicely to allow a post with a mobile version to be copied without linking back incorrectly. This is a reliable way of working, but requires a new mobile version of the copied post to be created from the desktop copy. If I copy the mobile version as well, there’s no way I can see to link the two copies.
If I remove the metadata filters and copy both parts of the original post, those copied parts link back to their originals. If I try to edit the link of either in their respective editing pages, it breaks the pairing of the original post and its mobile version. Your code must be chasing the old value of the link being updated to fix the other end of it – this is probably the right thing to do in more “normal” circumstances.
Given what you said about those two metadata fields, I’ve managed to correct the links between copies of the desktop and mobile versions in the database using PhpMyAdmin. This isn’t practical in general use, but it was useful to understand how things work.
What would be useful would be the means to select two separate posts and tie them together as a desktop/mobile pair. At the moment, a non-paired post has only the “Create Mobile Version” button in the Mobile Version panel on its editing page. The possibility also of pairing with an existing post would be useful and would provide a solution to copying desktop/mobile pairs (provided the metadata filter was used during the copy).