|Just another Perl shrine|
Welcome to the monastery.
I have Mac OSX Lion, so check your (Mountain Lion) system for any relevant differences to what I've posted below.
The error message says the argument is Invalid (i.e. not Empty, Missing, etc.). I'd say "... third gets an empty string." is an unreasonable assumption.
Running man scutil, I see --set pref [newval] with the following listed (under the --get option):
Given this, I'd read "Invalid argument" as "Invalid local (Bonjour) host name".
I know nothing about Bonjour but an internet search for "mac osx bonjour" produced many results including a number of hints/tips/tricks/howto type pages. https://www.apple.com/support/bonjour/ led me to Bonjour Overview: Domain Naming Conventions which contains a number of Bonjour Names for ... sections. I'll leave you to continue researching from there.