Messages open automatically at random times on Macbook Air
Even though you don’t want to sign out, it’s the fastest way to diagnose this. Make a log of how often you catch it launching - and once you know how long it takes for 10 launches - sign out for that time.

Then if it launches in that time interval, you know it’s launching locally. If you never get a launch, you know it’s messages coming in that launch the app.

Until you know if it’s a push notification or a local event launching it, you’ll have a hard time diagnosing either cause.