One should be true to your oath first then the state in which you live. Lee took an oath then reneged on it.
The code of chivalry included going to your sworn liege and telling him that you could not hold to your oath any longer and asking for release.
Lincoln could have ordered the Southern military arrested in the early days.
He resigned....you apparently consider that sacrilegious. I don’t. You have ignored so much more of Lee’s life before and after the Civil War it isn’t even funny