Htpasswd protection blocks panel login

Did you perhaps set 'api' => ['basicAuth' => true] in the config.php? Then the panel tries to log you in with the basic auth credentials - which won’t work if the credentials does not match.