not have all (one's) marbles
To not be completely mentally sound or stable. After he started bringing conspiracy theories into the conversation, I started wondering if maybe he didn't have all his marbles. It's easy to feel like you don't have all your marbles when you're that sleep deprived.
not have all one's marbles
Fig. not to have all one's mental capacities. John acts as if he doesn't have all his marbles. I'm afraid that I don't have all my marbles all the time.