Adding the hostname directive to the rc.local file worked and properly switched the hostname.
Thanks for reporting back. Marking this thread [SOLVED] for posterity.
I am still really perplexed as to why it works in rc.local, but not when run during the normal boot process when every other command I run in the script runs without issue. It is really confusing to me, but it is another problem for another day.
Because something that runs after your first script in the boot process overwrites what you did. The usual way to handle that would be to set the hostname to the desired value, but your requirements seem to preclude that approach as the hostname is not known a priori.