How to diagnose a «Something went wrong.» failure?

This article is only about the «Something went wrong.» exact message.
Other messages like «Sorry, something went wrong.» are out of scope.

The «Something went wrong.» message is always produced by the browser-based Magento 2 part (JavaScript), and it is always related to AJAX calls.

It is produced in the 3 code points (despite of its reputation, Magento 2 has more than a hundred of such code copy/paste duplications):

1. Magento_Ui/js/form/components/insert::onError()

2. Magento_Ui/js/grid/provider::onError()

3. lib/web/mage/utils/misc::ajaxSubmit()

So to diagnose the «Something went wrong.» issue, you should set breakpoints on these 3 code points.