At the bottom of that article, there is some JavaScript to show how to move this entry (the local AD) to the top. Unfortunately, it is hard-coded for a certain number of IDP and needs to be more dynamic.

"Back in December 2017 the User Experience (UX) for Azure AD login
changed to a centered (or centred, depending upon where in the world you
speak English) login page with pagination. Pagination is where you
enter the username on one screen and the password on the next. This was
covered in new Azure Active Directory centered sign-in experience
and recently in early April 2018 Microsoft announced changes to the UX
to include the removal of all the right-aligned pages (for example the
MFA screens and password reset)."

"Unless you have saved all the PowerShell cmdLet you typed to create your
custom theme in your pre-production environment, it is quite
challenging to recreate the exact same webtheme on your production
servers. It is easy to export a configuration with the Export-WebTheme
cmdLet. But it does not give you the ability to re-import what you just
exported. I wrote the following script to help with that:"