NurminenS the script was updated multiple times and so, the latest version no longer uses the AzureAD module. Instead, it does Graph API calls to do the preparation work (e.g., generating new application passwords). This is where your call fails (we receive a HTTP 400 instead of HTTP 200). Do you run the script with a Global Administrator account or Application Administrator (https://microsoft.github.io/CSS-Exchange/Security/CVE-2023-23397/#prerequisites-to-run-the-script-for-exchange-online)?
If the issue still occurs (even after running the script with a GA), please open an issue on GitHub as this makes it easier for us to track and investigate.
https://github.com/microsoft/CSS-Exchange/issues