How long does it last? I thought that it doesn't reset to zero after gen v? My Excadrill remained asleep for three turns even tho I already switched it out and stayed out of the fight for three turns and somehow it was still asleep. I also switched it in to eat some moonblasts as well as to burn the sleep turns and it was still asleep. So, how does sleep in usum actually work?
Generation VI onwards: Sleep now lasts 1-3 turns. A Pokémon's sleep counter no longer resets to its original amount when switched out.
--Bulbapedia on Sleep
You got unlucky and got the most number of turns possible, 3. Also the counter doesn't decrease while it is in party, i.e. not battling. You could switch it out and use another Pokemon for 30 turns and that wouldn't count. Is it possible you miscounted? It'd be unexplainable/ glitched if your Excadrill was asleep for 4 turns or more. 3 is within range.