Unable to get a redirect to https://

Your rewrite is working fine. It is the SSL/TLS certificate issuer that is the problem.

When you chose the Self Signed issuer, it clearly said that it is not trusted by browsers:

Try using another issuer, such as GoGetSSL, ZeroSSL, or Let’s Encrypt. If you do not want to do this, you can use Cloudflare: