I understand that you are receiving the following error:
websocket connection to failed: error during websocket handshake: unexpected response code: 500 reconnectingwebsocket.open @ reconnecting-websocket.js azure application proxy
If the application is accessible when bypassing the Azure AD application proxy, it's possible that the backend server certificate has expired. The websocket connection may fail and fall back to http, causing slow connection over http. If you renew/replace the certificate, it should work again.
If you are able to collect Fiddler data using -ServiceTraceOn , it will be easier to isolate the issue.
I would also recommend checking the troubleshooting in this thread and this thread. If you try these steps and still face this issue, feel free to send me an email at AzCommunity@microsoft.com ("Attn: Marilee Turscak") and include your subscription ID and a link to this thread, and I can open a support case to help resolve your issue.
If the information helped you, please Accept the answer. This will help us as well as others in the community who may be researching similar issues. Otherwise let me know if you have further questions.