How can I register multiple custom post fields to json?

The $field variable isn’t available inside your get_callback() function. PHP isn’t like JavaScript in that way, and that function can’t access variables from outside its scope (unless it’s global, but that’s a poor solution).

To pass the $field variable through to the callback function, you need to write it like this:

'get_callback' => function() use ( $field ) {
    return get_field( $field );
}