Mautic 5 SMTP 535 error

Your software
My Mautic version is: 5.0.4
My PHP version is: 8.0.30
My Database type and version is: Maria DB 10.5.23

Your problem
My problem is:

When testing my SMTP credentials in the config, i get this error:
Failed to authenticate on SMTP server with username “emailappsmtp.5cff9b4b6xxxxx” using the following authenticators: “LOGIN”, “PLAIN”. Authenticator “LOGIN” returned “Expected response code “235” but got code “535”, with message “535 Authentication Failed”.”. Authenticator “PLAIN” returned “Expected response code “235” but got code “535”, with message “535 Authentication Failed”.”.

When testing on the same server with swaks, everything is working and the email arrives:
swaks --to test@mydomain.eu --from hello@test.io --server smtp.zeptomail.eu --port 587 --tls --auth LOGIN --auth-user “emailappsmtp.5cff9b4b6xxxxx” --auth-password "xxxxxx
"

These errors are showing in the log: None

Steps I have tried to fix the problem: Verified my user and password 10 times…

I found out what went wrong, and i think this is a bug…

When i put the dsn in the config file (app/config/config.php) just as i can see it in above screenshot, (with password instead of SECRET) , it works!

So it must be something related to the env() function?