One reason for the error
“an error has occured while updating the device software. Use the emergency recovery function in the smart switch pc software”
is that you had interfered with the device (good or bad I do not know) then you allowed “Boot to system”.
Once you start to interfere you must see it through.
I am not familiar with Odin. I would not like to guide you on that.
I was not saying your stock ROM was not good; I was asking for a view of your Odin mode Download mode screen to look for any existing locks!
[HOWTO] Install /e/ on a Samsung smartphone with Windows easily is not very much wrong, but there are different steps for this device.
Notice how in @piero’s XDA link [ODIN (Windows)] the author corsicanu reminds us to keep watching the Odin mode screen.