In new spring (6.x.x) you have to compile java with "-parameters" option.
That option solved my problem getting path parameter from request.
See that post for more details.
So code like this will work:
@PreAuthorize("#n == authentication.name")
Contact findContactByName(@Param("n") String name);