If a device config in (shared) candidate is edited locally in the controller and the connection is opened or reconnected, the local device config edits are overwritten by a device pull.
At least issue a warning that local changes were overwritten.
One could do more such as not allow local edits on closed devices, clear local edits on close, or disallowing close if there are local edits, or even merge local edits with pulled config, but this may get complex and requested operation is unclear.
A warning would be a simple first step.