The problems in quantum foundations in the light of gauge theories