<?php
function change_accordion_icon( $block_content, $block ) {
  if ( $block['blockName'] === 'core/accordion-heading') {
    $block_content = preg_replace(
      '/<span class="wp-block-accordion-heading__toggle-icon"[^>]*>.*?<\/span>/s',
      '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M18 9.41L16.59 8L12 12.58L7.41 8L6 9.41L12 15.41L18 9.41Z" fill="#333333"></path></svg>',
      $block_content
    );
  }
  return $block_content;
}
add_filter( 'render_block', 'change_accordion_icon', 10, 2 );