I'm wondering from the perspective of the durability of a project, how can it be detected that a DPDT switch does actually switch.

For example, if I use two switches to switch between two power sources having different voltages, how can I know that none of the two switches is broken and it did not switch? If for example one of the switches (the positive voltage) did switch, but the other did not (the ground), then that will mean that the project is supplied with the positive voltage from one of the sources and the ground from the other.

The timing is ignored. Meaning, lets imagine that both switches switch instantly, if they are not broken.

The same example can be given and with MOSFETs I guess, and any other IC that have two internal switches regardless of what kind, so it is a general question, of how to detect a faulty component in the described example and prevent damages.

The only thing that comes to my mind is that I have to measure the expected change, but what if one of the power sources is not connected at all, there will be no current to measure.

If the switch was transparent, it could be visually detected I guess (that the switching actually took place), but not any switch is transparent and have components that are visually measurable.