No, he wasn’t a rifle company commander WHILE a Jag officer. Rifle company commanders can show up with backgrounds in many MOS fields.
But I assure you, he had no, none, zero JAG duties when he commanded a company.
Certainly, he held an Infantry MOS while in the job and had no JAG duties. We are tripping over differing terminology between Marines and Army. We call it detailing because every officer is assigned to a basic branch, but can serve in other MOS. Since the Marines don’t have a branch, you are correct. But, he was a JAG before a company commander and returned to JAG afterwards. Good idea.