If the name component length is greater than the permitted length, the error message points to wrong parent directory for mkdir and touchz.
Here are examples where the parent directory name is in error message. In this example dfs.namenode.fs-limits.max-component-length is set to 19.
The expected value for the directory was /user/hrt_qa/FileNameLength. The same behavior is observed for touchz