Local incorrectly adds port number when logging into wp-admin of a site

I think Firefox will always throw an error looking page because they don’t trust self-signed certificates. There isn’t anything that Local can do since this is a “feature” of Firefox.

Appending the port isn’t something that should be happening unless Local has the Router Mode set to localhost.

I’ve been trying to replicate this behavior on my own machine and I haven’t been able to get Firefox Developer edition to redirect to that port.

Since you mention that changing to a different version of PHP fixes things, I wonder if Local needs to update the PHP 7.4.1 lightning service.

Can you try following the steps outlined in this FAQ and see if updating the PHP lightning service helps?