I think the easy answer is - the code was ported from someone without real experience in daily usage of an ESX system. If i write a check or port a check for a system i don’t know, most time the check is missing some important things.
In the end the code is strange and makes no sense this way.