This is probably less of a bug than just annoying if you were playing uncautiously:
If you have 0 cards left in your deck and attempt to draw with an hourglass the system awards you with an instant loss!
I find, one should lose the instant ones turn starts and there are no cards left in the deck.
This way you wont get cheated out of your last turn during which you could possibly kill the oppo (or simply use your Eternity to not deck out.)