Something is rotten in the federal Department of Agriculture.

The yarn of this tale is still unspooling, but the murky events inside Agriculture Minister Barnaby Joyce’s department include a doctored Hansard, an extraordinary request for an extra Senate committee hearing, and the resignation or sacking of the Secretary of the Department.

The departmental drama has its origins in a minor correction to the parliamentary Hansard back in 2014.

The man who took the fall is Paul Grimes, a veteran Canberra bureaucrat handpicked to “babysit” Joyce by Tony Abbott’s office. Now Grimes’ career is over, another victim of a trigger-happy government that shows no compunction when shooting its messengers.

Grimes was highly regarded. He won a Public Service Medal in 2010 for his work responding to the global financial crisis. But he fell victim to the classic downfall of mandarins everywhere: he fell out with his minister.

Officially, the line from Barnaby Joyce is that his top public servant was sacked because of a difference in opinion. In the emollient phrases of Friday’s media release, “a relationship of strong mutual confidence between the Secretary and myself was not a realistic prospect”.

In an interview with ABC Radio yesterday, Joyce expanded on his reasons. Well, he tried to, anyway. “There was a difference of how we believe agriculture is to be pursued,” Joyce told the ABC’s Peter Lloyd.

The animus between Joyce and Grimes dates back to a relatively simple question in the House of Representatives about government drought assistance.

Labor’s Joel Fitzgibbon asked Joyce how much money the government had handed out in drought assistance. He wanted to know if money to affected farmers was actually flowing.

Joyce replied that it was, and even gave some figures. “I thank the member for Hunter for his question,” Joyce said. “He would be happy to know that over 4,000 applications have been approved for the farm household allowance.”

But when the Hansard was published a few days later, the text of Joyce’s answer had been altered. Mysterious new phrases such as “'if you were also a recipient of the Interim Farm Household Allowance” had suddenly appeared in the Minister’s transcript.

That was rather strange. Why would the Hansard have been altered, Fitzgibbon wondered. So he followed up with Joyce on October 27.

“Can the minister explain the inconsistencies between what he said in the House and the Hansard record?” Fitzgibbon asked. Joyce blustered that “this is exactly the same as what I said when I came into the chamber and proceeded to give exactly the numbers that were given to us at 3.30 pm that day.

But Joyce was wrong. The Hansard had indeed been altered.

Later that day, a sheepish-looking Joyce appeared before his Nationals colleague, Deputy Speaker Bruce Scott, with a correction.

Mr JOYCE: I seek indulgence to add to an answer from question time. The DEPUTY SPEAKER (Hon. BC Scott): The Minister for Agriculture has the call. Mr JOYCE: I answered a question on Monday, 20 October 2014 from the member for Hunter in relation to drought assistance. Further to my answer to the House on Monday, 20 October 2014, I provided additional information to the House on Wednesday, 22 October 2014. On 20 October 2014 I understand a request for minor edits was made to Hansard by my staff without my knowledge. My staff have been counselled. Consistent with standing orders, I have asked that the changes requested by my office be removed from the Hansard before the Hansard is finalised.

Labor has taken quite an interest in this apparently minor matter. Unilaterally altering Hansard is a very serious breach of Parliamentary protocol.

If the government of the day can simply alter the official record of the House of Representatives, the very integrity of parliamentary democracy itself could be said to be threatened. After all, if the Agriculture Minister’s staffers can insert a minor detail here and there on drought relief, what else in the Hansard might be suspect?

More than we realised, it appears. Yesterday, Liberal Senator Bill Heffernan announced he had “reams of examples” of where “whole paragraphs of Hansard have been changed.”

So how much Hansard-doctoring is going on? It’s hard to say. Only a close comparison of the audio transcript with the published Hansard would reveal the scale of the problem.

It’s not a great look for democracy when the primary source of the sovereign parliament of the land is unreliable. But Barnaby Joyce claims the whole thing is an advanced case of Labor paranoia.

“A mistake was made in my office, it was corrected, it's been investigated by the Senate, investigated by the Speaker of the House, investigated in a special Senate committee,” he countered.

But such democratic deficits are hardly unique. A more salient problem would appear to be the increasingly aggressive way the Abbott government is treating department secretaries, some of the key office-holders in the bureaucracy.

As the titular heads of the giant government organisations that go by the name of Departments, secretaries are the keepers of the flame of public service values. They are responsible not just to a minister of the executive, but in a broader sense to the Commonwealth and its laws, and ultimately to the citizens of Australia.

Secretaries are legally responsible to Parliament under the Public Service Act. They are also required to promote the impartial values of the Australian Public Service and are bound by the APS’ Code of Conduct.

The old convention about departmental secretaries was that they were effectively permanent chieftains, secure in their tenured employment at the top of the bureaucratic tree. Legendary mandarins like H.R. “Nugget” Coombs were more important policy prime-movers than many of the ministers they nominally worked under.

That hasn’t been the case for many decades, and recent trends are only accelerating the decline of the arms-length permanent head. While secretaries are meant to have fixed five-year terms, recent developments have eroded this statutory obligation.

The Abbott government sacked a number of departmental secretaries on taking office, including Don Russell, Blair Comley and former Immigration boss Andrew Metcalfe (ironically, from the very Agriculture post now vacated by Grimes). Treasury Secretary Martin Parkinson was also put on notice that he would be let go after Joe Hockey’s first budget was prepared.

Grimes was fired shortly after he attempted to request an extraordinary Senate committee hearing to disclose new information that had been omitted from a Labor Freedom of Information request.

“I have further relevant information that would, I believe, be highly pertinent to the committee’s consideration,” Grimes wrote, to Senator Bill Heffernan.

But when Grimes turned up to give evidence in early March, no bombshells were thrown. The Agriculture Secretary gave perfunctory answers. Was he lent on to toe the party line?

We may never know. Grimes is gone and Joyce is standing fast.

Sudden executions are not a recipe for free and frank advice. While top public servants still enjoy many statutory protections and plenty of soft power, they are increasingly serving at the pleasure of the government and even the minister of the day.

That’s the very opposite of what recent public service reforms have been aiming at. Former Defence secretary Paul Barratt told the Guardian’s Lenore Taylor that “what it all boils down to is that a departmental secretary is a tenant at will and you can be out of a job in 24 hours”.

“Of course that has a chilling effect on people’s willingness to give frank and fearless advice,” Barratt added.

We’re well on our way to the American system where top brass in the bureaucracy clear out after every election, to be replaced by the ruling party’s favoured apparatchiks. That can't be a good thing. Public service politicisation erodes democratic accountability, and ultimately sullies the institution of democracy itself.