A skillset I am familiar with that can pay extremely well is the design of complex systems software from first principles. Most software companies don't have this skillset on their payroll, and honestly most companies don't need it. Companies that do need it
really need it though, and they can often directly attribute many millions of dollars to the work, so the exceptional compensation seems reasonable, demand greatly outstripping supply notwithstanding.
These days, people with this skillset are commonly employed to design data infrastructure software for cases where open source software has material deficiencies in terms of scalability, performance, or efficiency. Optimization of complex AI/ML processes is another emerging area where I see friends being hired. It typically isn't a leetcode style hiring process.
A software engineer cannot be retrained to do this role in months, the domain is too deep. It requires multiple years of diligent self-study to achieve functional competency, plus many more years for mastery, and I've never seen an exception to this. Much of the essential theory is diverse and never covered in undergrad e.g. greedy routing theory, universal sequence prediction problems, agreement-free consistency, etc. Efficient reduction to practice on real hardware is esoteric, non-obvious, and poorly documented. You need similar levels of low-level knowledge about how silicon behaves as software optimization specialists. In most cases, all existing software is demonstrably unfit for purpose which often implies a likely requirement for inventing a novel and/or unorthodox software design that is superior to what has been done before (the alternative is that all popular implementations that might be fit for purpose are just really poor, in which case you do a blank-sheet implementation of a conventional design).
Consequently, the new talent pipeline is almost entirely sourced from people who devote years of their life to mastery solely because they love the problem space. We simply have no practical way to produce this skillset at a rate sufficient to meet demand. In principle you could build a full-time educational program that focused on training people up effectively but it would still require years to produce more talent like this.