I published an article about how to tackle that situation in an interview when you are asked to give an honest rating of your skills on my personal blog.
https://blog.oliverjumpertz.dev/how-to-react-when-asked-to-rate-your-skills-in-an-interview
https://blog.oliverjumpertz.dev/how-to-react-when-asked-to-rate-your-skills-in-an-interview