Electron systems with strong geometrical frustration have flat bands, and their unusual band dispersion is expected to induce a wide variety of physical properties. However, for such properties to emerge, the Fermi level must be pinned within the flat band. In this study, we performed first-principles calculations on the pyrochlore oxide Pb2Sb2O7 and theoretically clarified that the self-doping mechanism induces pinning of the Fermi level in the flat band in this system. Therefore, a very high density of states is realized at the Fermi level, and the ferromagnetic state becomes the ground state by a flat-band mechanism, even though the system does not contain any magnetic elements. This compound has the potential to become a new platform to project the properties of flat-band systems in the real world.