Here's a "normal" solution which works (30/11/2022) for Outlook in Office 2016 Professional
Dear all,
I got the same problem tonight and asked Yahoo, what might be the problem. Below the answer of Yahoo Customer Care :
Due to some recent changes designed to improve the safety of our platforms and member privacy, we’ve made the process to create App Specific Passwords more secure. This can result in some difficulty when trying to set up an ASP from a new device. Please ensure that you try creating an app password without using an Incognito browser and use a browser where you have signed into that account in the past, for at least a couple of days. If this is not successful, there may not be a workaround; as we don't know if or when this feature will be available, we encourage you to use Webmail or the Yahoo Mail app to access your email. We’ll share the feedback on how this experience has been for you internally. Thanks again for letting us know.
My thinking was to give it a try on my mobile app for Yahoo-Mail and I did the steps, Yahoo tells on how to generate a password for third-party apps
On my phone and on my tablet, I was able to generate the password :-)
Hope this will help