I feel that's where the NHL should change their rules. If you have two Doctor recommendations that state player is unfit to play in the NHL and they want to retire it should be possible without cap penalties. It's just some nonsensical cap maneuvering at this point.
Chris Pronger was a good example of this.
My friends and I were talking about it last year or the year before.
If a guy cannot play (like Ellis), let him retire with his guaranteed contract (paid by the team or insurance). It'll open up a spot on the roster and not complicate things with the salary cap. However, if the player comes back in any professional league (NHL, KHL, Swiss league), the team gets hit with DOUBLE his AAV for twice the amount of time he had remaining.
Ellis as an example - he "retires" tomorrow and draws his salary this year from insurance. In 24-25, he decides to try it again, just to make sure. If he were to make the team, the Flyers would get hit with $12.5 cap hit for the next 8 years.
Actually... maybe the current method is the best. It sounded good when we were drinking and smoking cigars. What the hell do I know.