The $name is a Replace token, this token is often used as "Default value" when you create a new item the $name is replace by the item name.
do you have also the $name when you preview the page? are you sure this had somethings to do with the publish?
Found out with field it is, if it is different between CMS and CD you probably need to publish the templates?
It happens often that replace token like $name are not replaced, for example when you create a new language version.
To speed up the publish you can install and use the Sitecore Publishing Service.