A bunch of the tests in
decorate-sort-tests.pl fail on NetBSD because it does a stable sort by default, and the test cases assume that's not the case. The -S option uses the 'compare entire lines on ties' approach, but that option means something else with other sort implementations.
Possible fixes (I can work on whichever one you prefer):
Special case for detecting NetBSD and adding -S to sort options only then if stable sort is not explicitly requested in decorate options.
Prefer gsort over sort - if the devel/coreutils package is installed, that is GNU sort.
Also a related suggestion:
Add a --sort-command option to datamash and decorate to use instead of the default sort. And/or have an environment variable that can be used.