By default, a Logical Switch does not allow multiple guest VLANs. In order to use guest VLANs, the below configuration is necessary.
VMware NSX Data Center for vSphere 6.x
To resolve this issue:
Create the Logical Switch via REST API call to enable guestVlanAllowed:
<virtualWireCreateSpec>
<name>Test LS VLANs</name>
<description>Logical Switch to test tagged traffic</description>
<controlPlaneMode>UNICAST_MODE</controlPlaneMode>
<guestVlanAllowed>true</guestVlanAllowed>
<tenantId>virtual wire tenant</tenantId>
</virtualWireCreateSpec>