What you are describing is not normal behavior for macOS. Double-clicking on a file will open that file, regardless of how recently the enclosing folder was opened.
Have you rebooted your Mac? If not, that's the first step. If that does not help, then see if the problem is present when you boot in safe mode. That process performs some system cleanup and clears caches, and also disables 3rd party extensions that may cause problems.
Start up your Mac in safe mode - Apple Support
If that does not correct the issue, test in a new user account. A newly-created user account will have all settings at default, and if the issue does not occur in that new account then it provides guidance on what may need to be changed to correct the issue.
Add a user or group on Mac - Apple Support
Once the testing is complete, the new account can easily be deleted.
Delete a user or group on Mac – Apple Support
Those steps will help to isolate the problem.
It might help to download and run EtreCheck, written by a long-time forum member. The free version is fine. Post the full report using the Additional Text button. No personal information is revealed.

I cannot replicate the behavior you describe. For example, here is a folder of RAW images from a trip in February 2025. I have not accessed that folder or any files in that folder since that time (I convert the RAW images to JPGs that go in the Photos app, then archive the RAW images).

When I open the folder and double-click on a file, the file opens in the designated app (in this case, DxO PhotoLab):


Given that I cannot replicate the issue you describe on macOS 27.0.1, it does not appear to be a bug in macOS. You can certainly still report it to Apple. Bugs can be reported to Apple here:
Feedback - macOS - Apple