Position:
Yes, if you save position on OK and Close, you should save position on Cancel, because Cancel is about cancelling the action, not cancelling where the user placed their window to be most useful for them.
Michael Medlock (Research @ Microsoft, then Facebook) and Steve Herbst (Head of UX @ Amazon) researched multiple UX books and guidance for years.
They came up with a terminology deck related to common UX traps.
The trap you are describing is called Variable Outcome under the Habituating tenet under their framework.
"Variable Outcome" means "the system responds differently at different times to the same user action."
They sell their cards on https://uitraps.com. I'm not affiliated and don't benefit from sharing the link, although I'm a big fan.
State:
Cancel should never save state, since the idea of cancellation is to undo whatever was done in the task in the window.
In the Tenet & Traps framework keeping state on Cancel falls under these traps:
OnClose
toOnCancel
, since they usually mean the same thing.OnClose
should save but notOnCancel
.