Has this way of comparing internal energy got any sense?
Yes. This is the binding energy.

In general, the binding energy is defined as the amount of energy released upon bringing infinitely separated particles in to contact. This would then be a negative number. Another sign convention is the binding energy can be viewed as the amount of work required to separate two atoms or molecules (or whatever) which are in contact. This binding energy is the negative of the first one (is a positive number).

For molecules, you might be more familiar with the term bond energy instead of binding energy. For a diatomic, these two things are the same. Notice that when we talk about the bond energy in a molecule, we treat that bond as being a diatomic molecule.

For the diatomics you mentioned, the electronic energy for the heavier diatomics will be artificially larger than the lighter ones simply because there are more electrons. For this reason, when comparisons between systems like this are made, people usually divide by the total number of electrons. So, in this case you can visualize putting in positive work to bring the protons near to each other and then adding the electrons one at a time to the system until it has no net charge. The binding energy per electron is then a measure of the average amount of stabilization the system gained for each new electron. The same thing can be visualized for the nucleus of an atom, but in that context you will read of the binding energy per nucleon.

This same concept is also quite useful for molecular clusters and other non-covalently bound systems as a measure of the strength of intermolecular interactions. In that case it is infinitely separated molecules which define the zero of energy.

This concept of energy relative to infinitely separated components of a system is a very useful one as it gives an unambiguous definition of the strength of interactions. As a fun thing to ponder, consider how to determine the strength of an internal hydrogen bond? As it happens, to the best of my knowledge, there is no general method for determining the strength of internal hydrogen bonds as there is no natural zero of energy to choose. Some people have tried using the red shift in vibrational frequency, but this too is still a bit ambiguous and hard to determine.