How top fix the «Invalid method Magento\Customer\Block\Account\Navigation::removeLinkByUrl» bug

To fix the issue remove the following code line:

The removeLinkByUrl method is absent in Magento 2.
It exists in Magento 1.x, and Magento 2 team mistakenly left it the Magento 2 code while ported the code from Magento 1.x to Magento 2.

Looks like the bug is reproduced only in the situations when the «Magento_Customer» module is processed by system before the «Magento_Theme» module.
These modules do not set a processing ordering relative each other, so the bug appears in random cases, when you installed some third-party module which uses some <sequence> rules.

Another effect of the same Magento 2 core bug is: Bug: the order's title is shown at the bottom of a customer account's order page (and my fix)

It is fixed in the core a week ago: