In reply to zero_h:
As a class method, task static is illegal.
See if these posts help you
https://verificationacademy.com/forums/systemverilog/automatic-variables-inside-static-method#reply-42858
https://verificationacademy.com/forums/systemverilog/what-exact-difference-between-static-tasks/functions-and-automatic-tasks/functions-please-explain-clear-example#reply-44935