I found a temporary workaround, initially I was trying a try-catch like this:
// $output = call_user_func_array('sprintf', $args);
try { $output = call_user_func_array('sprintf', $args); }
catch(ArgumentCountError $e) { }
However it didn't work. But this did:
// $output = call_user_func_array('sprintf', $args);
try { $output = sprintf($args[0], $args[1], $args[2]); }
catch(ArgumentCountError $e) { }
EDIT: Ok the following works too, just needed a backslash ?
// $output = call_user_func_array('sprintf', $args);
try { $output = call_user_func_array('sprintf', $args); }
catch(\ArgumentCountError $e) { }