This has been resolved in NSX-T 3.0.2 and newer.
Workaround:
As a temporary workaround, it is possible to create a Service beforehand, with no destination port, then use this service instead of a Raw Port-Protocols object (Raw Port-Protocols from UI or L4PortSetServiceEntry from API).
- From Policy UI, under Inventory > Services, click on Add Service.
- Enter a name, i.e. "TCP-Any"
- Click on Set Services Entries
- Click on Add Service Entry
- Enter a name, i.e. "TCP-Any"
- Select the Service Type: TCP
- Leave source and destinations ports empty
- From Policy UI, under Security > Distributed Firewall, create or edit a rule to use the Service "TCP-Any" instead of the former "Raw Port-Protocols" object
- Click on Publish
The above example uses TCP, but the same procedure applies for UDP.