The Mashgiach at a kosher venue was asked by the mesader kiddushin to serve as an eid, since the couple is not frum and the rabbi and ceremony were halachic orthodox. There was nobody else who was able to do it. Should the mashgiach have said no? He felt that because it was an emergency, he was mekadesh the shem shamayim. He didn’t leave the premises, the goyim didn’t know he was leaving the kitchen, and he was gone no,more than 10 minutes. He has to leave the,kitchen at times anyways to light sternos and check the bar.
As long as this is within the normal time he would leave the kitchen for good reason, such as those mentioned, or to take an important phone call or use the restroom, it would be permitted for this as well. In general as long as the workers know he can pop in at any time, that is sufficient supervision to provide hachgacha.