GMail's IMAP server actually works well... it just violates the spec in several obnoxious ways.
For Inky (http://inky.com) we had to devote a bunch of Gimap-specific effort into explicitly syncing flags, for example, because Gimap simply doesn't notify clients of flag changes. Inky has to poll Gimap for flag changes rather than passively learning about them via IMAP IDLE.
And the treatment of labels as folders is a mess for IMAP clients, as is the All Mail folder, which -- if not handled properly -- effectively generates a duplicate of every message in every folder.
But Gimap does work reliably in our experience. It's a bit slow, but it's less broken than IMAP servers run by other major providers (who shall remain nameless).