This is the best way to removes commas:
add_filter( 'generate_category_list_output', 'tu_remove_category_commas' );
function tu_remove_category_commas() {
$categories_list = get_the_category_list( ' ' );
return sprintf( '<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', // WPCS: XSS ok, sanitization ok.
esc_html_x( 'Categories', 'Used before category names.', 'generatepress' ),
$categories_list
);
}