Are we talking about a forgotten passcode, or a forgotten Apple ID password?
If you forgot the passcode for the old phone, but you had iCloud Photos enabled on it, and you know (or can reset) your Apple ID password, you may be able to get your photos back. From iCloud, not from the old phone itself. You can forget doing a Quick Start transfer to the new phone if you don't know to unlock the old one.
If the photos were in iCloud Photos, you can access your photos by setting up another device to use iCloud Photos under the same Apple ID, or by logging into the iCloud Web interface https://www.icloud.com/ with that Apple ID.
If you forgot your Apple ID password - Apple Support