WP add_action factory

Check out the php callable manual.

A PHP function is passed by its name as a string. Any built-in or user-defined function can be used, except language constructs such as: array(), echo, empty(), eval(), exit(), isset(), list(), print or unset().

However, in your code sample you are using an anonymous function, which can be passed directly.

[
array(
"name" => "my_custom_action",
"cb" => function(){return true;}
)
]