It's possible to cause this exception to occur when passing objects marked with the ByReferenceAttribute in conjunction with quickly dropping and re-establishing a connection. It's possible that transient proxies from the old connection are still hanging around (thus not being collected) and if the new connection now creates new sentient proxies, it might re-use ids which are still in use by the old proxies (because used/free id ranges are unfortunately not negotiated between clients) and if the new and old proxies happen to implement different ByReferenceAttribute interfaces, then this exception occurs.
It's possible to cause this exception to occur when passing objects marked with the ByReferenceAttribute in conjunction with quickly dropping and re-establishing a connection. It's possible that transient proxies from the old connection are still hanging around (thus not being collected) and if the new connection now creates new sentient proxies, it might re-use ids which are still in use by the old proxies (because used/free id ranges are unfortunately not negotiated between clients) and if the new and old proxies happen to implement different ByReferenceAttribute interfaces, then this exception occurs.