Oh yes, this has happened to me many times. I've been working 20+years. It is demoralizing but you know what I learned? That it's really for the best because somewhere there IS a better job, one that will make you happy and be fulfilling. That doesn't mean there aren't stinker jobs out there, just that you need to be careful.

By far the most important thing I learned is to listen to my little voice. If it's hesitating and saying welllllll....... Don't take it!!!
Without a doubt every time I pushed that little voice aside, even when I was desperate to get a job to pay the bills, I ended up in a lousey situation and very unhappy. That unhappiness lead me to be unhappy in other areas of my life. Believe me, it's not worth it.

So keep looking and know there really is a better job out there, one that is meant just for you. It will be worth the time and effort. And by all means, LISTEN to your little voice when an offer is made. Good Luck!!!!!