When I paste something LibreOffice creates a commentary called "StartFragment" and "EndFragment". How to avoid or remove this?

This means that LibreOffice used HTML format stored in the clipboard; and by default, it includes comments (for whatever reasons). Personally I believe that if these comments are ever useful, they shouldn’t be the default; but this deserves an enhancement request (which you might file if the issue bothers you).

In the meanwhile, you might use HTML format without comments when pasting:

HTML format without comments

Removing the already inserted comments is done by right-clicking the comment (blue rectangle on your screenshot) and choosing a suitable option starting with Delete ....

This issue exists on multiple operating systems and has to do with how clipboard data is formatted on the host operating system. It is a bug.

Reference: HTML Clipboard Format
Reference: Bug 63094

Try the following: Paste as Unformated Text