You enabled a feature where low-res photos will be stored locally on your Mac, but the original resolution photos will be stored in iCloud. So when you are disabling sync, iCloud choses to delete the low-res photos on your Mac, and keep it in iCloud.