To clarify I can create a scratch org where I can manually add a community I have setup the OrgPreference.settings and the features in project-scratch-def.json correctly. The problem is when I create a community pull back the metadata and try to create another scratch org with the updated metadata I get the following:
force-app\main\default\portals\Customer Portal.portal-meta.xml Not available for deploy for this organization
force-app\main\default\networks\Test.network-meta.xml Not available for deploy for this organization
project-scratch-def.json
file settings{ "orgName": "Demo Company", "edition": "Developer", "features": ["Communities"] }