On my KUbuntu, I experienced a lot of crashes from libreoffice 7.2 when switching windows.
As per a post on an archforum, the solution is to add
XDG_SESSION_TYPE=x11
at the beginning of the /usr/bin/libreoffice file
Apparently, this is a recurring bug that has been present for a few years.