The problem was resolved without rewriting the code. It seems that it takes some time for the privacy & security settings to be reflected. If you have the same error as me and have just changed your privacy & security settings, I suggest you wait a while.
I tried sending DM to 3 Discord accounts using on_member_remove(). Only one of them received it safely. Others did not. The error has occurred.
That is why two of my accounts couldn't receive DMs from the bot. At that time I had just changed the settings.