The headless version of libreoffice uses the PDF settings you define using File -> Export as PDF (not directly export) Adjust the settings you need there, PDF/A 1b is sufficient for most cases.
Basic headless command
/Applications/LibreOffice.app/Contents/MacOS/soffice --headless
Tell libreoffice to convert to PDF