Missing the trials would come under your school's assessment policy. Mine has two options - one, if a student knows in advance that you will be unable to sit the exam then they have you sign a document to not tell anyone what is in the paper and do it early - or later but then it is used as a 'estimated mark' and not the actual mark. If a student is ill on the day and has the appropriate documentation they do it later and again it is used as an estimate.
Missing the HSC with the appropriate and approved documentation means a 'misadventure' appeal and so school assessment mark would be used to determine the final mark. If the documentation isn't there then a zero would be awarded for the exam which would affect the ATAR.