If Insurance accepts the medical retirement he gets all remaining contracted wage paid by them and all that cap space opens up.
If Insurance does not accept the medical retirement ticks the right boxes the club then has to decide if they pay him (in which case it would come from cap) or if they do not, which would free up the cap space.
Generally speaking the club would pay in the second instance and may have even made that agreement with the player prior to anything being made official.
But a player does take a risk nobody will pay them any further if they just choose to announce their retirement.
If a player retires (either non-medical or medical but not covered by insurance) the NRL will also have some discretion as to when & what cap space opens up.
An example of where this can get a bit confusing is Greg Inglis. He retired and no part of his wage was held against the Rabbitohs cap for the next year, but for the year of the retirement what he had been paid so far and what they paid him for the rest of that year for off-field work were both held against Rabbitohs cap.
This may have been where we were at with Dale also, given we employed him.
Edit: just to add, my understanding is from point of retirement Greg was only paid a much lower off-field job wage and none of his playing contract