I got an email regarding this from the technical support. For the sake of sharing the information, I am pasting it down here:
Thank you for the information. As noted in the documentation, "hold on" and "hold all" are the same. The "hold all" will be removed in a future release.
The command "hold on all" is equivalent to function syntax "hold('on','all')", which passes two arguments to the function "hold". The function "hold" is able to take two arguments, in which the first argument should be the axes object, and the second argument is either "on" or "off" (or "all"). In the example you provided, the function could not identify "on" as an axes object, that is why there is an error. Note that starting from MATLAB 2019b, the input checking is implemented.