I’ve rarely heard this line spoken in such a way that gave it anything but a sort of “I know you are but when am I?” quality.
But looking at it now – it’s got a sense of – splitting hairs about location. Hamlet accuses the gravedigger of lying in the grave. The gravedigger accuses Hamlet of lying outside of it – which confirms its ownership, at least in the negative.
Also – the status of the characters is immediately obvious to both of them. Hamlet delivers a sirrah, an informal address and the gravedigger gives back a You. He doesn’t know who Hamlet is but he knows he should be using formal speech with him.