Breadcrumbs disappear on cache clear, come back with subsequent cache clear
In a node use the breadcrumb builder directly:

\Drupal::service('breadcrumb')-&gt;build(\Drupal::routeMatch())-&gt;toRenderable();


The node gets cached already and the cache metadata of the breadcrumbs bubbles up to the node.

In a page it's preferable to place the block in a region (can be a region of its own) and then place the variable of the region in the page template.

If you want to use code to place the block, make sure you use the block for the correct theme (you have to query the block table with the property theme for this). Now it seems like you use the breadcrumb block placed first on your site, not necessarily the one for your theme.