The only thing that I’ve found that is consistent when it happens is that the keyboard was active before it triggers.
Closest I’ve come to repro is that it more often happens if the keyboard is active in the composer and you have something happen that forces an app switch, but it’s really inconsistent.
Sometimes it triggers when minimizing the composer to quote part of a post.