Error when using pkgutil to flatten an application bundle into a flat package
pkgutil is the wrong tool for this.  Use pkgbuild instead.  The syntax is...

pkgbuild --root /path/to/application_bundle.app --identifier com.company.application --version 1.0 --install-location /Applications /path/to/flattened_package.pkg


Some MDM's require a product archive instead of a flattened package. If that is the case, you can then use productbuild to create a product archive. The syntax for that is...

productbuild --version 1.0 --package /path/to/flattened_package.pkg /path/to/archive.pkg