Ruth Gilfillan was a detective chief constable within Police Scotland's National Rape Taskforce and National Human Trafficking Unit when she made inappropriate comments in a row over a Celtic birthday cake in 2015.
She was arrested at work after she allegedly joked about refusing to eat the football-themed cake and made comments about children being at risk of abuse in Catholic schools.
The procurator fiscal decided not to prosecute, but an internal investigation by the force saw her dropped three ranks to constable, resulting in a significant drop in salary.
Ms Gilfillan, who no longer works for Police Scotland, accepted she made inappropriate comments but has now lodged a claim for disability discrimination against the force.
She claims she was suffering from depression at the time she made the cake remarks.
A preliminary judgement from the tribunal states: "The claimant has accepted that she made inappropriate comments of a sectarian nature to some of her colleagues on August 20, 2015.
"These resulted in a criminal investigation (where no proceedings were ultimately taken against the claimant) and a disciplinary process, the outcome of which was demotion to the rank of constable."
The judgment, which looked at whether or not Ms Gilfillan had a disability at the time of the incident, found in her favour. Ms Gilfillan described her workload as "horrendous". This was backed up by the force and the chief constable, who acknowledged that the pressures on senior officers at that time were "punishing".
Employment judge Sandy Meiklejohn said: "I am satisfied that the claimant was from late 2013 struggling to cope with an unsustainable workload in an environment where the culture was that 'you just got on with it' rather than complaining and where, in any event, there was little or no prospect of further resources becoming available to relieve the pressure."
The tribunal also heard that Ms Gilfillan - who joined Strathclyde Police in 1994 - suffered an assault in 2003 and was subjected to "poor treatment" by her sergeant at the time. A few months later, she was also subjected to "malicious rumours about her alleged association with a criminal element from where she had been brought up" and an investigation was carried out.
Despite the rumours were found to be malicious, Ms Gilfillan was still moved department - a decision which she said "killed" her. She claimed that these issues contributed to her mental health problems.
The judgement states: "The claimant described herself as becoming quieter and more insular and feeling down or angry."
Ms Gilfillan requested a transfer to another department on three separate occasions but never received one. Judge Meiklejohn said he accepted the evidence of her psychiatrist that she was suffering from a "moderate depressive disorder" at the time of her outburst.
This led to her suffering from a low mood, disturbed sleep, fatigue and exhaustion, anxiety and irritability.
The judge added: "Having looked at each element of the statutory definition and considered the guidance, I decided that the claimant was disabled... as at 20 August 2015."
A Police Scotland spokeswoman said: "As proceedings are ongoing we are unable to comment."
Ms Gilfillan also declined to comment.