Did you tried dumping the value of $carousel_image
For image field to return Array, return_type
must be set to array
https://www.advancedcustomfields.com/resources/register-fields-via-php/#field-type%20settings
/* (string) Specify the type of value returned by get_field(). Defaults to 'array'. Choices of 'array' (Image Array), 'url' (Image URL) or 'id' (Image ID) */ 'return_format' => 'array',
Also what’s the use of save_format
in your code . I can’t find it in the documentation.