Just out of curiosity would it be inadvisable to have a litter box in the same room as my chameleons terrarium.
Yes.
My cat likes to sleep in my room so it wouldn't be very stressful for my chameleon to be seeing my cat.
‽‽‽ 



How does
that follow?
...
My problem is he scratches at the door in the middle of the night and I don't want to get up 5 times a night let him use the bathroom.
To get in or out? Never mind. Bad idea. Does the cat have a UTI or BPH or something?
So what I would like to know is would it be dangerous to have a litter box in the same room and I believe I read somewhere that it would not be advisable but I would like to know at the very least. Thoughts?
I think it's all been said by others above.
When Missus & I were starting out, we kept a couple guinea pigs because of landlords & economics.
We kept their hutch in the kitchen (warmest room). Some time later we got a puppy—then a kitten, and the litter box was also in the kitchen.
The dog ignored the guinea pigs, and vice-versa. The cat—however—used to sit on top of the hutch and vultch over the side, stalking the GPs upside down (that part was actually kinda funny, BUT...) Whenever the cat came into the kitchen, the GPs got excited (not in a good way). When she got up on the hutch, they'd both hide in their hide, and shake so hard out of fear that it literally shook the whole hutch.
Needless to say, we re-homed the GPs to a catless home. Since then, we've been acutely aware of pet interactions and providing as stress-free an environment as possible for any/all in our care/family/home.
Other than hiding & colors, IDK how you'd tell if a chameleon was that scared; hiding & colors are what they do anyway.