The Marketing cloud ID changes when you pass the registration, resetting the session and capturing the previous page as the referrer vs the page entered on. We have two domains before registration and after registrations. Not sure whats the issue is. Its not happening all the time.
The ID service should maintain a consistent 'mid' value even across domains (assuming both domains have the ID service deployed). The only exception to this would be for browsers that reject third-party cookies. You mentioned this is happening only some of the time. Have you done any analytics analysis to determine if it might be a certain browser or device?
You can learn more about how the ID service works in a video I put out a few weeks ago. The link is below: