What browser do you use? could that also have an influence? because I didn't experience what you experienced and I've been using Brave Browser for several months and my account has never been automatically logged out of Twitter.
I use Chrome browser and it happens when I click on like a post or repost. I barely do it as I usually only read so I can not understand why Twitter detects me like a bot and log out my account. A notification appears and if I refresh, my account will be required to log in again. It only happens recent weeks, less than one month.
Talking about Elon and his actions on Twitter, it seems to be making social media better, but I just see it as an act of frustration because it turns out this didn't give him what he expected.
He has a lot of ideas, some are good, some are bad and I see he wants to change it to be a better platform. Succeed or not, I don't know but talking about bots, I think he is right on his intention to control bots that are contaminated many social media platforms.
We use a platform but want to interact with actual people, not with bots.