I've just looked up the rules which the University of Hertfordshire use to calculate your overall classification. See D6.1.1 on page 177 of
this document. The rules they provide are not quite how you've described them working. Here's what they say:
"For students being considered for a final award with Honours classification, the Programme Board of Examiners will determine for each student:
i the average numeric grade of the best
90 credits at Level
6 or higher; and
ii the average numeric grade of the best remaining
90 credits at Level
5 or higher; and
iii a combined average numeric grade, weighted 75% (i) and 25% (ii), above; and
iv the student’s Honours classification will be considered on the basis of this combined average numeric grade."
You've said that "a second year average worth 59.66%". Was this 4 modules, each worth 30 credits? I suspect not as you've mentioned "a 15 credit module at level 5".
In order to apply the logic in the regulations, we need a module-level break-down of both level 5 and level 6, showing the number of credits each is worth and what mark you achieved for each. For any modules for which you don't yet know the result, just put "unknown" or something. Also, please mark the referral/deferral unit - in case that's relevant to the calculation.
With regards to you question about using a 15-credit referral/deferral module from Level 6 to replace a poorer 15-credit module from Level 6 - yes you can. D6.1.4 specifically says, "All pass grades (including referred passes) and compensated grades are eligible for inclusion in the determination of the combined average numeric grade, with the exception of grades awarded for non-University of Hertfordshire modules studied during a period of study abroad and additional modules which are not part of a validated programme of study." (I assume the part about "grades awarded for non-University of Hertfordshire modules" doesn't apply.)
Do note, however, that your referral/deferral module has likely been capped. D5.2.2 iv says, "Students who are successful in referred assessments will be awarded a P(REF) status code for the module. The numeric grade for the module will be limited by any assessment elements which have been failed and then passed at referral being capped to the minimum pass grade."
(Amusingly, whilst searching the document for the word "cap" - to see whether one would apply to the referral/deferral module - I came across a rule which says, "During the examination, students will: ... not wear baseball
caps, hoodies or other types of hat which obscure their face."