It’s rather a bug, thank you for noticing.
I’ve just fixed it for 6.8.8 and above, but in 6.8 you will have to set cuba.deepCopyNonPersistentReferences application property to true to turn the fix on, because it can be a breaking change if some code expected the old behavior. Starting from 6.9 it will be the default.