The pad character should be a string, not a digit. That may be what’s causing your problem. Try “0” instead of 0. With a numeric value, StrRight decides to space pad instead.
The prototype for StrRight is in MeTools.sh, along with a whole stack of other handy things I’d never noticed before, if you want a closer look at it. I should also thank you for asking this – despite more than a year of working with CMAC, I’d never noticed the … syntax for adding optional parameters to a macro.