htaccess and htpasswd

Your behavior is logical. the profile.php page is in the protected /wp-admin/ folder.
the wp-login.php is in the root (/), which is not protected.

File not found.