In contrast to what you might think about a claustrophobic reference, the "walls are closing in" actually means that someone was home for so long that they start coming up with dumb ideas. This usually happens when students are unemployed over winter break/summer or when adults are on medical disability. The absence of sunlight into the home enables Vitamin D deficiency, which in turn results in someone coming up with ideas that would have otherwise not even come to mind.

This can also happen when someone has too much time to think.

Peter: I came home for winter break and recorded an unnecessary motivational football speech. I directed, produced, and acted in my own mafia film over the course of the summer.
Mike: Stop, Stop. Chill b. The walls are closing in.
Peter: Hmmmmmm?
Mike: You're a joke.
Peter: What? I had time to write a script, scout a location, pay actors (including myself), hire my dad as a cameraman, and shoot a movie.