fix custodian-limit checking for phantom byte strings

Closes PR 14036