Why does the Coach role reset during overnight scripts?

Axiom manages the coach role differently than other roles in the system. Where a lot of roles are tied to the status of the class being completed or active, coaches are tied to the broader school year. Anyone tied to a "team" as either a coach or assistant coach has that role added back until the school year itself changes by the nightly scripts.

The system automatically stops giving people the "Coach" person role if you remove their permissions from any teams they are assigned to or change the role from "Coach" to "<None>" or "Other". 

The Coaches tab of the team record allows you to adjust the role of coaches for a particular team.

The other option, depending on how close you are to closing the school year is to not make any updates. Once the school year rolls over, the system stops looking at any teams they were assigned to in the previous year and no adjustments are made to their person role.