The most important thing is that your problem is solved.
And thanks for sharing the update here.
By the way, since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others.". and according to the scenario introduced here: Answering your own questions on Microsoft Q&A, I would make a brief summary of this thread:
[Sharepoint 2019 and office online server 2019 - External Data Refresh Failed]
Issue Symptom:
For days I have been facing a problem accessing external data on sharepoint. When I try to access the data using Secure Store authentication, everything works perfectly. Now, when I try to access the same data using windows authentication, it always gives the below error message:
Current status:
I used EffectiveUserName. It's much simpler to set up, it's working great and it solved my problem.
You could click the "Accept Answer" button for this summary to close this thread, and this can make it easier for other community members to see the useful information when reading this thread. Thanks for your understanding!