Twig date function not working on custom field within node
Before you need convert field field_my_date form 2021-10-01 to timestamp

You can use hook_ENTITY_TYPE_view_alter to be convert it to timestamp

use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\Display\EntityViewDisplayInterface;


/**
 * Implements hook_ENTITY_TYPE_view().
 */

function hook_ENTITY_TYPE_view_alter(array &amp;$build, EntityInterface $entity, EntityViewDisplayInterface $display) {
  if($display-&gt;bundle()=='node_type'){
    $field_date_timestamp = strtotime($entity-&gt;get('field_my_date')- &gt;value);
    $build['field_my_date'] = \Drupal::service('date.formatter')-&gt;format(
    $field_date_timestamp, 'custom', 'M.d.Y');
  }
}


in file twig node tempalte {{field_my_date}}