This is a complex case, because in your example, the command does not generate an error, you are using the wrong redis.calland redis.pcall(because ARGV[2]there are nil, according to the error message). Therefore, in both cases, the error is not restored.
Here is an example where a team really fails and you can see the difference:
redis 127.0.0.1:6379> set foo bar
OK
redis 127.0.0.1:6379> eval 'redis.call("hget","foo","bar")' 0
(error) ERR Error running script (call to f_9e6d82f0740926e0a70775430bda59a54d4e0664): ERR Operation against a key holding the wrong kind of value
redis 127.0.0.1:6379> eval 'redis.pcall("hget","foo","bar")' 0
(nil)
, pcall, script nil. , ?
redis 127.0.0.1:6379> eval 'return redis.call("hget","foo","bar")' 0
(error) ERR Error running script (call to f_d0a8dce7264708876edf262052788fc90a8e8325): ERR Operation against a key holding the wrong kind of value
redis 127.0.0.1:6379> eval 'return redis.pcall("hget","foo","bar")' 0
(error) ERR Operation against a key holding the wrong kind of value
call , ( - Java, Python ..) , .
pcall err, " " Redis, . ? !
redis 127.0.0.1:6379> eval 'local t = redis.pcall("hget","foo","bar"); local r = {type(t)}; for k,v in pairs(t) do r[
1) "table"
2) "err"
3) "ERR Operation against a key holding the wrong kind of value"