Hi, There is a was a new update from MS that did that.
I see you got the answer for your question. https://answers.microsoft.com/en-us/windows/forum/all/icons-keep-re-arranging-whenever-i-connect-the/332bde6a-6b73-463e-b06a-c7a8bdcf3533
Did this work out for you : https://www.thewindowsclub.com/keep-desktop-icons-from-moving-when-undocking
You will continue maybe to have that happen. I change my screen resolution to play a game and all my icons move. When finished I set the resolution back and they are all back in the same place.
LOL, not a big frustration for me.