I've thought about this a lot retrospectively, considering if I was to ever have to re-train in another specialty:
1) By far the most protective characteristic: Have a skill that others can not PHYSICALLY perform; even if legislators change the law to allow others to do it. Obviously, this means procedural fields with the surgical ones being at the top. Even if the diagnostic skills of an NP aren't that great... they can still physically do the job of a hospitalist; even if done poorly.
Of course not every one wants to do surgery. I find it incredibly boring. But some other characteristics:
2) Having a specialty that people will pay CASH for is great for security. It divorces you from the insurance companies.
3) A specialty which you can OWN your own practice, even better if you own the facility. Every time there is a patient encounter/procedure done in that facility, the OWNER is getting either a facility fee or technical revenue in their pocket. If you don't own it... someone else is making money off your back without doing a damn thing. This generally means specialties that have outpatient as an option and are not married to a hospital (like emergency or anesthesia).
4) A specialty where you control the flow of patients. If you control the patient.... you control the cash flow. This is especially pertinent for those specialties where there are a large amount of ancillary tests performed downstream which generate revenue (Oncology).
5) Something that has a certain amount of acuity to it... meaning if not done correctly; there are consequences. You can screw up basic primary care for a long time... so people are ok with a nurse doing it. Not many people would be ok with a nurse directing their cancer treatment.
Of the procedural specialties, I think Plastic Surgery is one of the most protected. You can own your own surgery center, people will pay cash for many procedures. Urology is another great one many don't consider. You won't find many NP surgery centers.
The procedural medicine specialties like GI, Cards, Pulm can have a high volume procedural practice that makes bank.
Not everyone wants to do procedures though. Neurology is not a bad choice. There is great need and it is very complex. I'm sure there are niches where you can make cash. That is the reason Psych is hot, but you can find a psych NP on every block in some locales these days. Pain clinics can be profitable with a decent lifestyle (but you have to deal with pain patients).
Diagnostic radiology isn't a bad choice, if you don't want to work with patients. Imaging in cancer management is skyrocketing. You can work remotely. People keep harping on AI doing reads but IMO that is unlikely to replace you, but will just make you more efficient.
I personally can't see myself doing anything else except working with cancer patients, so if I started over I would probably do Med Onc. But if I had to re-train TODAY after already going through Rad Onc residency I would choose Interventional Radiology. Then I could do some of my own biopsies and maybe trailblaze some new HDR approaches... but main reason would be to have an actual procedural skill under my belt that the legislators won't give away. Maybe double boarded in DR so I could read remotely if needed.