This issue was addressed with improved data protection. This issue is fixed in iOS 17 and iPadOS 17, macOS Sonoma 14, watchOS 10, tvOS 17. An app may be able to access edited photos saved to a temporary directory.
https://support.apple.com/en-us/HT213940
https://support.apple.com/en-us/HT213938