Custom 404 template file in Drupal 8
<p>How can I create a custom <code>404 page</code> in Drupal 8?</p>

<p>I have created a new page(Content) in the backoffice called <code>404</code> (node number 100).
I have set  it as the 404 default page at <code>Configuration</code> > 
<code>Basic site</code> settings.</p>

<p><a href="https://i.stack.imgur.com/qJu2T.png" rel="noreferrer"><img src="https://i.stack.imgur.com/qJu2T.png" alt="Settings"></a></p>

<p>It works with the content that I have set in the Backoffice.</p>

<p>But now I want it to be editable programatically and I don't know how can I create the overriding file.</p>

<p>I have tried to create <code>mytheme/templates/html--node--100.html.twig</code> and it works only when the request its directly that url (<code>node/100</code>), but it doesn't work when you try a random slug on the URL and drupal has to resolve it. When this happens, drupal is serving me the content that the <code>404 page</code> has in the backoffice and not in the file that I have just created.</p>

<p>I have tried several files like <code>page--404-html.twig</code>, <code>html--node--404.html.twig</code>, <code>html--page--404.html.twig</code>,... but it doesn't work neither</p>

<p>Can anyone lend me a hand?</p>