A longtime financial officer for the Brockton school district began ringing alarms about overspending and a potential budget shortfall as early as July 2022, more than a year before officials announced a $14 million deficit last month, according to the man’s attorney and emails he shared with the Globe.