Google's John Mueller was asked if putting an H5 before an H1 on a page would end up hurting the page from ranking well in Google. John said "nope" it won't end up hurting the page from ranking organically in Google Search.
Here are those tweets:
nope.
— 🍌 John 🍌 (@JohnMu) August 4, 2020
John has said previously that the numbers themselves, H1 vs H6, etc, does not matter either. So it is not like this can hurt you but if you do structure your pages well, it can help Google better understand the page and site.
Forum discussion at Twitter.
Update: 2023 answer the same:
Why would you do that? It seems like the kind of thing you'd want to get lined up (for accessibility & search), if you care about that level of detail. This won't make or break your site for search either way, so I'd put it on the rainy-day nice-to-do list.
— John, aka "a total bell cheese" (@JohnMu) September 26, 2023