WP site URL changed to have HTTPS but still homepage does not redirect

In case anyone runs into similar issues. Here is what worked, as suggested by ItsMePN.

If your site is on a loadbalancer such as CloudFlare, is_ssl() doesn’t work.

Neither did it work for me on a site hosted on “Cloudways + Digital Ocean”

Here is the gist https://gist.github.com/webaware/4688802 for force-ssl-url-scheme.php you need to download & upload it under wp-content/plugins & activate it.

Worked perfectly.