Sadly, I had this experience lately. Even though I had the firewall explicitly set to allow connections using Screen Sharing, for some reason my Mavericks OS X 10.9 server hiccuped and I couldn’t access it via screen sharing.
Here’s how I resolved my dilemma: