During the initial application, when I submitted my cover letter, there was a field for salary expectations. When I completed it, I kept it on the low end of the range I would accept to avoid being automatically excluded by an ATS.
I then received an invitation to do a case study, which I did. It took it me about 5 hours but I didn't mind, since I found it interesting and I appreciated it as a good way to evaluate applicants.
Following the case study, I received an interview invitation. I met with the interviewer, we had a good chat about my case study and the role, and she also confirmed my salary expectations (I stated the same number I'd put on the initial application.)
Following the interview, I received an invitation to a 2nd round interview. That interviewer led off with the fact that the role salary cap was LESS THAN HALF of my stated salary expectations and asked if I could be flexible. (I said no.)
If there is such a wild misalignment between salary expectations and what the role can offer, then they had no business wasting my time with a case study and preparing for two interviews. It was very unprofessional, although the people themselves seemed nice enough.