Get form fields data on form submission using forminator plugin

While I can’t comment on Forminator on this stack, there is a basic mistake involving add_action causing the error message in your log.

The cause of this is that your function requires 2 arguments to work, but you did not tell add_action this, so it used the default 1:

add_action( string $hook_name, callable $callback, int $priority = 10, int $accepted_args = 1 ): true

https://developer.wordpress.org/reference/functions/add_action/

You need to specify that your function takes 2 arguments when using add_action using the 4th argument, e.g.

add_action( ‘test_action’, ‘callback’, 10, 2 );

Additionally, the quotation marks in the code in your question are using smart quotes ‘...’, use "..." or '...' instead