I finally solved the problem. In the browser development tools there was an error message saying that the "WebSocket failed with code: 6". This indicates that Web App Server failed to validate the origin of the request. This check was implemented in MATLAB R2021b to prevent cross-site hijacking. One cause of failure is if the protocol from the origin (e.g.: reverse proxy server) does not match the protocol of the Web App Server.
The solution is the following:
If possible, try setting up the Web App Server such that it is on HTTPS mode with SSL enabled. You can do so by following one of the two MATLAB documentation pages below:
Production version: https://www.mathworks.com/help/webappserver/ug/enable-ssl.html
Development version: https://www.mathworks.com/help/compiler/webapps/enabling-https.html
To find out, whether you use the Production oder the Development of MATLAB Web App Server:
If it is the production version, what is the license number? You can find a list of your software licenses by going to your account on the MathWorks site.