I cannot replicate the behavior you describe. On my 16" M4 Pro MBP running macOS 27.2, I can click on a file or folder, wait a moment then click in the name field and the name field becomes editable. For example, a new folder that I just created.

Note there there are other ways to edit the name of a file – you can select an item then press return, or you can Force Click on the name field. Those methods are documented by Apple (unlike the click, wait, click again method though as stated, that still works).
More info from Apple: Rename files, folders, and disks on Mac - Apple Support
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.