That happens more often than you think, Its actually happened to me twice..once with a telco I worked for where my department was eliminated as a cost saving measure, my department had 16 people when I started, was down to 2 engineers by the time I was let go. Within two weeks they were calling both of us to try and get us to come back, we both refused to come back in a salary position but offered to come back as contractors...shit was bad so they paid up, I spent a total of one month in two cities and made more in that time than I made in 6 months while I was working there.
The second time was two years ago with my own business, a client decided I was too expensive and decided to "go a different direction", the guy they hired was a relative of one of the company's partners and over a holiday break they managed to have their main server go down after a storm. Their new IT guy kept trying to fix the old machine with random parts, turns out he was hiding the fact that he hadn't had a good backup in over a month. I got a call saying they needed my help, I explained that they had ditched me, and that it was a holiday break (my biggest client closes for a week during the holiday season), they said it didn't matter what it cost they just needed their data. I told them I would do it on an hourly basis on the condition that the idiot who was now in charge just stayed out of the way. I billed them at 2.5x my standard rate, I kept backup hardware of all my clients gear on hand and still had the board and raid card that matched their system at home. Got the new machine up and didn't even have to restore anything, fixed the backup problem made a good backup and presented them a nice bill. They offered to "bring me onboard" again, I told them I didn't have time but wished them luck with my replacement.