Using wr_ids to hold pointers often seems to lead to issues like this.
So it might be best to rework the CM so uses wr_id some other way.
I'll also remind you of the following Sean Hefty quote, circa
September 2004 ;)
"But, yes, users wanting to be able to cancel MADs cannot use duplicate wr_ids."
- R.