Failed to authenticate on SMTP server with username

Your software
My Mautic version is: 5
My PHP version is: 8.1
My Database type and version is:
mariadb
Your problem
My problem is:

Having used the right SMTP credentials and tested all ports, I am getting

Failed to authenticate on SMTP server with username "apikey" using the following authenticators: "LOGIN", "PLAIN". Authenticator "LOGIN" returned "Expected response code "235" but got code "535", with message "535 Authentication failed: The provided authorization grant is invalid, expired, or revoked".". Authenticator "PLAIN" returned "Expected response code "235" but got empty code.".

Manually testing the same credentials using swaks on the commandline works.

swaks --to *@*.net --from *@*.me --server smtp.sendgrid.net --auth LOGIN --auth-user apikey --auth-password '*'

Steps I have tried to fix the problem:

I verified credentials and ports many times. They work.

And of course I found the issue right after writing.

There is a small lock icon set as a placehalder. Make sure you detele it before you paste your key.

THANKS! Can you believe that I spent 8 days on this without finding the issue?! I thought that the lock icon was NOT part of the password field, so I was not even trying to remove it.