There's at least 2 other factors that explain the difference between UK and France/Germany.
One is that the role of the gvernment/public sector is far lower in the UK compared with other European countries - things like the post office, railway, electricity, gas, water, telecoms are through listed companies in the UK, but not necessarily so in France or Germany. Also in Germany, many large companies are partially owned long-term by banks and so the %age of the company of the company which is traded on an exchange may be much less than 100%. The same is true in France for government ownership. As an example, the largest chipmaker in Europe is ST Microelectronics, it's now down to below 30% government ownership, having been much higher in the past, but it still means that the market cap on the stock exchange is not representing the full contribution to the GDP. Germany also has a much higher %age of private/family companies than elsewhere in Europe.
The other big reason is the one that you alluded to. The UK stock exchange has some mega-corporations that make the bulk of their profits outside the UK, but are listed in London - particularly in oil, mining and banking. France & Germany does not have this. You might notice places like Netherlands (with Shell, Unilever) and Switzerland have similarly large %ages relative to their GDP.