Hello minegroasprilla,
Thank you for your post and please excuse for the delayed answer.
Please try to set X264 encoder in preferences before the editing start.
You can select it in "Tools" -> "Preferences" -> "Smart mode settings" -> Encoders/decoders -> select X264 encoder (Custom) -> click the "Force selected" button -> click "OK" -> Trim the file.
You should get the higher quality on the output file with this codec.