Start by writing down everything that took place in great detail. Include dates and times the best you can.
Sit down with the agents Broker and see what they are willing to do. It may be possible to resurrect the deal.
If this isn't satisfactory, you can talk to the franchise or office owner/manager, then the Local Board of Realtors and finally the state licensing office.
Stay focused on what you want most, which I suspect should be the house first, your money second and the agent to take responsibility third. Your hurt and disappointment may want to rearrange the list, but your anger with the agent won't get you what your most want.
I am sorry to hear about your situation. I must admit I am little confused as to how an agent can cancel anything while you are under contract. I would recommend you look back over your contract between you and the seller to see what happen i.e. time lines adhere to etc. Then, I would suggest you contact the Broker for your agent regarding your concern(s) with the agent and the failure to close. More then likely, the Brokers will be able to work something out to assist you.
Best of luck to you
I'm sorry to hear about your bad experience with your agent which you feel caused you to lose both the house you wished to purchase as well as your earnest money deposit. I suggest that you contact your agent's Broker (her boss) about the situation and if you aren't satisfied with the Broker's response and action then contact the local Board of Realtors for Sunnyvale and submit a complaint.
Good luck to you!
Prudential Connecticut Realty