The oil companies could only successfully sue for compensation for being banned from fracking, when the ban only applies to foreign companies, i.e. only when the ban is discriminatory.
Source: The EU commission says “The protection given covers a limited number of specific actions which can concretely affect an investor’s daily business operations in a foreign market, i.e. discrimination, denial of access to justice, expropriation without compensation and the inability to transfer capital to invest.“