The redirect URI in your appsettings.json (or wherever it's referenced in your code) needs to match exactly what you have in the app registration. If it's being redirected to http then that means there's a reference in your code that has the http URL rather than the https URL. There also cannot be any extra slashes, spaces, or anything else that would cause these to have a mismatch, and the app ID/client ID and tenant ID need to match in both places. I would search through your code and make sure that everything matches what you have in your app registration.
If you provide your correlation ID, timestamps, and request ID I can check too and see if I can find the mismatch, but from what you described it seems like the URLs are not the same and need to be standardized.