Substantiation of the field functional method as applied to scattering by a doubly periodic magnetodielectric structure