Scale up and down an ellipse doesn't work within a function

The Guidelines—Asking Questions suggest an MCVE:

:)