Agree with all the advice that doing it internally will likely be easier (per the "When you're doing something new, don't do something new" maxim). That said, changing companies can enable rapid evolution. It'll (potentially) make it easier to be the manager you want to be, as opposed to the manager they think you'll be. In many cases it's likely better to do it where you are, but wanted to advocate for the benefits…
What changed when you switched?
- shedding of responsibilities (no longer an expert)
- shedding of preconceptions (new people, new me)
- being new means that people are looking for you to bring your new perspective, which isn't always the case at an existing role
- working with all new people polishes management skills as you can't rely on built up relationships
And then there's the choices you make when interviewing about what kind of company culture/new manager/new team you're going to. Like, if I care a lot about DEI/4-day work week/etc, and my current company doesn't, do I want to work to make that happen (if even possible), or go to a place that also cares about that which allows me to learn and iterate on something that I care about.