Normal
I know that some species of Avicularia spray poo in defense. There may be others that do, as well. Your tarantula is in that small space because she is hiding... at least she thinks so. They wind up in all kinds of awkward positions while doing so. If you find her lying on her back, she's not dead - she's molting, and you should avoid disturbing her during and after this time while her exoskeleton is hardening. I thought I should save you some later worry.