Considering the European Union (EU) climate targets, the heating sector should be decarbonized by 80% to 95% up to 2050. Thus, the macro-trends forecast increasing energy efficiency and focus on the use of renewable gas or the electrification of heat generation. This has implications for the business models of urban electricity and in particular natural gas distribution network operators (DNOs): When the energy demand decreases, a disproportionately long grid is operated, which can cause a rise of grid charges and thus the gas price. This creates a situation in which a self-reinforcing feedback loop starts, which increases the risk of gas grid defection. We present a mixed integer linear optimization model to analyze the interdependencies between the electricity and gas DNOs’ and the building owners’ investment decisions during the transformation path. The results of the investigation in a real grid area are used to validate the simulation setup of a sensitivity analysis of 27 types of building collectives and five grid topologies, which provides a systematic insight into the interrelated system. Therefore, it is possible to identify building and grid configurations that increase the risk of a complete gas grid shutdown and those that should be operated as a flexibility option in a future renewable energy system.