How to use LibreOffice with --headless option?

If I try to execute /Applications/LibreOffice.app/Contents/MacOS/soffice --headless
by a user not logged in, e.g. _lp, the program exits with the message
No Info.plist file in application bundle or no NSPrincipalClass in the Info.plist file, exiting

What to do?

Don’t have Mac and I don’t use LO in headless mode, but maybe this could point you in right direction: How do I run LibreOffice --headles on Mac […]?

Hi, I know that this question is kind of old but still without a solution here.

Short: I just created a shell file with:

exec /Applications/LibreOffice.app/Contents/MacOS/soffice "$@"

You can check the same problem with a complete answer here