Some time ago, I applied for a job with a Government Department here; it was one I was more than capable of doing and met the paper qualifications for.
After spending ages filling in the forms (and there are a lot of forms for Government jobs) and jumping through all the hoops, I found out that the job was given to the person who had been filling in for the vacant position.
It turns out they’re not allowed to actually tell you that the job is actually being done by someone who already works there in the meantime when you apply for Government jobs.
I was told, however, a form of “Secret Code” to avoid encountering the same problem again: Ask “Is someone currently occupying this position in a caretaker or temporary capacity?” If the answer is “Yes”, it means “We’ve actually given to job to Bristow from the Buying Department, but are legally required to advertise the position anyway”, and it’s not worth wasting my time applying for the job as I don’t have a frog in a blender’s chance of getting it no matter how qualified I am.
If, on the other hand, the answer is “No, this is an open position”, it means there’s no-one doing the job at the moment, and they’ll consider outside applications for the position.
I agree it sucks being jerked around, but the consolation is that you probably don’t want to work for a company that treats people like that…