I didn't finish watching the movie, I only watched part of it. In this film, everyone suddenly becomes afraid of outdoor spaces, so much so that a man who was forcibly removed from a building had a heart attack and died after being forced outside. This coincides with a volcanic eruption happening somewhere, and I think that the characters conclude that the eruption released some kind of disease that caused the agoraphobia. The movie features characters trying to get out of their workplace and make contact with their loved ones by means of a tunnel.
Is this The Last Days (2013 )...?
In 2013, a mysterious epidemic spreads across the planet: humanity develops an irrational fear of open spaces which causes death within seconds. Soon the entire global populace is trapped inside buildings. As Barcelona descends into chaos, Marc sets off on a quest to find Julia, his missing girlfriend--without ever venturing outside.
The Last Days (Spanish: Los últimos días) is a 2013 Spanish science fiction thriller film directed by David and Àlex Pastor. The film had its world premiere on March 20, 2013, in Barcelona, and stars Quim Gutiérrez as a man who must deal with the potential end of all humanity.
From a review:
Barcelona-based project manager Marc (Quim Gutierrez) is struggling to meet his work deadlines, a fact duly noted by Enrique (Jose Coronado, grizzled and charismatic), a hard-nosed troubleshooter brought into the company to clear out deadwood. The film transitions fairly smoothly between these scenes, set in the past, and those set in a far more unstable present following some vaguely specified cataclysm, possibly a volcanic eruption that may have spread noxious gases over the globe. In any event, Marc and his fellow employees (most of them sporting ragged beards) haven’t left the premises for three months, are about to run out of food, and have developed a severe case of agoraphobia.