What is the progress bar periodic update function return data?
The core example is in FileWidgetAjaxController::progress. You need to return a JSON-encoded associative array with message and percentage keys. For example:

$progress['message'] = t('Uploading... (@current of @total)', ['@current' =&gt; format_size($status['bytes_uploaded']), '@total' =&gt; format_size($status['bytes_total'])]);
$progress['percentage'] = round(100 * $status['bytes_uploaded'] / $status['bytes_total']);
...
return new JsonResponse($progress);