Hello SRG
I've never experienced your problem - because I never use gedit. Does the same problem occur if you use "Kate" or "Atom"?
Kate is the first software package I install on any GNU/Linux computer. I have never "gotten-along-with" gedit.
How did you install LibreOffice - deb, snap or Flatpak?