We have a Blue Prism bot which opens an Excel file on SharePoint.
The process runs 6 times a day, but about once per day, we get the Microsoft Sign in box below:
This is unexpected and stops the process. If we rerun the process and Excel launches successfully.
Additional details:
- Bot OS: Windows 2019 Server
- Office version: Microsoft Office 2019 (we are not allowed to use Office365)
What is causing this and how can we prevent it from happening?

Are you using SharePoint GUI to open this Excel file? That seems like a bad idea. Please familiarize yourself with this page: https://support.microsoft.com/en-us/topic/considerations-for-server-side-automation-of-office-48bcfe93-8a89-47f1-0bce-017433ad79e2.
The best way to work with Excel files on SharePoint is Graph API. You can find ready to use components on Digital Exchange. If it's hard to have app registered in your company's AD, check out SharePoint REST API which you can setup with site admin.