I’m not sure of a way around this. I’ve done it.
I need someone to do a specific set of tasks, but there’s also a wider group of tasks which I’d like someone to do, but it isn’t urgent.
The posting goes out for the task we NEED. If someone more senior applies, and they can do more than the role needs, we pay them more.
This is a non-problem: if a candidate approaches you for Role A, and you decide they'd be a great fit for Role A+B, then create Role A+B, and perform the perfunctory interview, then hire them at the new role.
There is no (and I feel comfortable with this absolute) scenario where you need to keep the salary range hidden, or where a published salary range prevents you from hiring a candidate for an expanded role. None.
The only thing transparent pricing does is result in an informed participant in the market, which is pricing signals and thus something Capitalism.
Once you go down the route of asking for special exemption to make your business work in an open market, you're not doing Capitalism anymore.