Hello @kirill_nn,
In which IDE are you using SonarLint ? Which version of the IDE and of SonarLint ?
First you could check that your project is properly connected to SonarQube by opening the SonarLint Logs (see instructions for Eclipse, IntelliJ and VSCode). You should see some traces indicating that the binding is properly configured.
Do you have the same problem if you use this code outside of a record ? It might be a discrepancy around Java version. In SonarLint, the sonar.java.target property is deduced from your project configuration, while this parameter is probably set in your CI script during analysis. Could you check that those properties contain the same value ?