The Chief Statistician for Scotland is Prof. Roger Halliday.
I think it would be reasonable to believe that a government Chief Statistician would understand the value in collecting accurate data and how that data would be employed in the drafting of government policy, particularly with regards to healthcare, children's services, education and the running of the nation's economy.
Not recording sex accurately through a national census would have a huge impact on the accuracy of any such exercise, and I reckon the vast majority of professional statisticians and data scientists would be aghast at any effort to do precisely that.
I suspect a 'Chief Statistician' for a country would be a member of a number of professional groups - The Royal Statistical Society for one, which attempt to maintain high standards in the profession.
That profession, thanks to Prof. Halliday, has now been rendered a joke, subject to widespread ridicule and a sense that it isn't actually a proper profession.
I reckon the likes of the RSS, or whatever statistic-related professional bodies Dr. Halliday is a member of, should be requesting he attend to a meeting place of their choice to explain how he has not brought his profession into disrepute.