Topic on User talk:Garrett
You were on the right track. The separator should be set in #arraymaptemplate to avoid the issue with trailing/empty commas (see the documentation for details).
The #switch can have multiple values use the same result by leaving them blank as needed (see Template:API/switch). Once the invalid category has populated a bit more there may be some other valid values to be added.
Invalid values are shown on the page normally and Category:Invalid template usage (API) is applied (I experimented with having it fall back to the unknown symbol, but this looks messy if multiple values have been used).