Goedenavond Valerio, welcome here!
It is essentially correct that if the source's line is too broad, then some light is not absorbed by the observed sample, so the absorption measurement is wrong.
There is no vital need here to consider photons. They only complicate things.
==========
If you want to put photons, then don't forget that they have a linewidth too, independently of any consequence of Doppler or collisions. In this case, they are emitted by some transition of an electron from a higher energy level to a lower one. This transition happens over a finite time called fluorescence time (a laser would hasten this transition), the photon lasts as long, hence the photon has a certain spectrum of frequencies (or energies) rather than a definite frequency. This minimum "natural" linewidth and the fluorescence time are fully linked numerically.
Even if some wave can be written exactly as sin (2πFt) over some finite time, it is not a pure frequency, because an other sine of close frequency resembles that sine over the limited time, as the phase of both sine drifts little. The acceptable frequency mismatch is inversely proportional to the pulse duration. So a receiver, spectrum analyser... does show that the pulse contains nearby frequencies too.
If you like signal theory and processing, it's the story with pulse width, bandwidth, window and sample duration, and it's a property of the Fourier transform time <-> frequency.
If you like quantum mechanics, it's Heisenberg's uncertainty. The energy takes time to be accurate.
There are more uncertainty relations in quantum mechanics, for instance the position and the momentum can't be both arbitrarily accurate. You can understand that one too as a property of the Fourier transform. But for instance the impossibility to know exactly a particle's magnetic moment along two axes does not result from Fourier.