A logic issue was addressed with improved restrictions. This issue is fixed in iOS 16, iOS 15.7 and iPadOS 15.7. A person with physical access to an iOS device may be able to access photos from the lock screen.
https://support.apple.com/en-us/HT213446
https://support.apple.com/en-us/HT213445