An accused is given credit on sentence after pleading guilty, partly because he “fessed up,” admitted his wrongs and saved the Court time of proving his offence at a trial. However, there are situations when an accused admits guilt and pleads guilty to the charge, but contests some of the aggravating details/circumstances which the Crown/Police claim. In such cases, if the Crown wishes to rely on those contested facts for sentencing, it must prove them Beyond a Reasonable Doubt. This can lead to a form of “trial” after a Guilty Plea, called a Gardiner Hearing.
If after the Hearing, the Crown proved the aggravating features of the case, does this diminish the credit given to the accused for pleading guilty?
It depends what effect the Gardiner Hearing had on the court process.
For example, one of the mitigating factors of a guilty plea (aside from remorse) is to spare the complainant from testifying. Requiring the complainant to testify at the Gardiner Hearing would reduce the mitigation afforded for the guilty plea.
See as example of lessening the mitigation of the Guilty Plea in Ngeruka,  Y.J. No. 51:
51 Mr. Ngeruka is entitled to some credit for having entered a guilty plea. This said, the guilty plea was entered on February 28, 2014, just prior to the March 3 trial date, thus limiting the mitigation it provides to some extent, when compared to an early guilty plea. The mitigation that Mr. Ngeruka’s guilty plea offers is further reduced as the complainant was required to testify in detail with respect to her sexual history at the Gardiner hearing. This is not, of course, an aggravating factor, as requiring the Crown to prove aggravating facts at a sentencing hearing was certainly within Mr. Ngeruka’s right to make full answer and defence; it does, however, nonetheless have the effect of lessening the mitigating impact of the guilty plea. Greater mitigation is generally afforded when a complainant is not required to testify, particularly in sexual offences. Had L.S. not been required to testify I could have given greater emphasis to the mitigating impact of the guilty plea.
In contrast, another type of situation where it did not reduce the mitigation is found in J.L.D.,  O.J. No. 1521:
81 In my view, the guilty plea warrants consideration as a mitigating factor on the sentence. While certain aggravating facts remained in dispute following the plea resulting in the necessity of a Gardiner hearing, I conclude the offender’s frail memory and advanced age prevented counsel from securing the requisite directions necessary before an informed factual acknowledgment could be made.
So it seems to depend on the circumstances to decide if the mitigation of a guilty plea is to be somewhat diminished or fully preserved.