I have already raised the issue on StackOverflow (https://stackoverflow.com/questions/75627353/strange-security-error-in-spring-boot-3-0-2) and tried all the suggestions, but nothing helps. I think it is a bug. It seems that the RequestParam and PathVariable annotations don't go with the PreAuthorize annotation anymore. There is also an example about a map. Then the parameters can be addressed by name. I have not found a workaround for a PathVariable.
Comment From: wilkinsona
I can't see anything in the Stack Overflow question that suggests there's a bug in Spring Boot. If there is a bug somewhere, it's more likely to be in Spring MVC (part of Spring Framework) or Spring Security. Your question on Stack Overflow would benefit from a minimal, reproducible example. It's also not clear if you have tried the suggestion to compile your application's code with -parameters. A complete yet minimal example would clarify that as well.
I'm going to close this issue now as we don't want people to waste their time helping on Stack Overflow when someone else is helping you here. Please update your Stack Overflow question with a complete yet minimal example and we can take things from there.