I see node preprocess does this
$variables['node'] = $variables['elements']['#node'];
and then in the template one can do this
{{ node.id }}
but when I create a custom entity and do the same, I never get past all the the errors like
Exception: Object of type Drupal\Core\Field\FieldItemList cannot be printed. in Drupal\Core\Template\TwigExtension->escapeFilter() (line 476 of core/lib/Drupal/Core/Template/TwigExtension.php).
What are they doing special for node?