The requirement is to publish either minimal salary or salary range for the position from the advertisement. If company has several positions available then specific minimal salaries should be given for each.
Sometimes companies create a specific position for an interviewee after getting to know the candidate. For example, a candidate might have an unexpected unusual skill.
What does that have to do with providing a salary range for a particular job posting? That specific position created should also have a range - publish that. Normally you have to interview other candidates for this position too.
That would be making it difficult to adapt the job to fit the person.
Unless you’re some VP/Director/Distinguished Eng/C-level etc, this doesn’t happen in practice. Those jobs don’t follow normal job posting rules anyway, they’re usually sought out.
99.99% of the time, I doubt the job is ever adapted for the person. They come in with that skillset and are usually expected to grow and meet the needs of the other job areas.
So, you want the 1 in 10 000 (likely 1 in 1 000 000) hyperspecific job posting to affect the rules for the rest?
And nothing stops them from doing that
And then the candidate sues claiming bait and switch.
The candidate isn't going to complain if you give them _more_.
Why would you sue for that? There's no contract in place
And in any normal court they will lose since its a different position and they agreed (paper trail) for that switch. Or they could be just let go if company is too careful. Not that such situation happens often in real world, I never even heard about even one.
If they would sue it would also burn their professional creds permanently, nobody sane would ever want to hire such a problematic person.