This problem started recently (in September 2022) after google's latest search algorithm update. Many webmasters are complaining about this error, and many might not have even noticed it. But, there is no help or update from google. If you look at google's support page, it does not make sense when the SSL lab test is not complaining about the certificate issue.
I was also getting this error for my pages on this website. Since I am redirecting HTTP to HTTPS using "301 redirect" on the server, I thought maybe google is considering HTTP and HTTPS as two different pages after their latest update. To solve this issue, I enabled HSTS (HTTP Strict Transport Security) on my server with a max-age of 1 year. Not sure if this is the right solution, but it worked for me. Now I do not see the error when I submit pages to google for indexing in the google search console.
If you are using the Nginx server, add the following line to the server config file:
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
If you are using the Apache server, add the following line to the server config file:
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"
Restart your server. In 2-3 days, Google will learn that your website serves only HTTPS pages and will stop showing the error.