different places have different metrics
pff and some other places chart pressures and sacks by attributing blame including to the QB
typically it's about affecting the QB within a certain time threshold - the specifics of which differ depending on the specific place doing the charting - some places look at an effect on the QB, some places look at a sphere of influence/distance to the QB e.g. how close were you to the QB when they threw the ball etc.
not all pressures are created equal obviously
in your example, depending on the organisation charting, that scenario would either not be recorded as a pressure, or would be recorded as a pressure but the pressure would be assigned to the QB