If you have a VanillaSwap which started in the past, and you ask for the floatingLegBPS, then the value returned includes the effect of a rate shift on all the coupons which have yet to be paid, even if they have already fixed.
The same holds for overnight index swaps - coupons drop out atomically on the cashflow date, rather than diminishing in effect as they progressively fix.
That means you can't use this number to estimate change in NPV for a shift in the curve. Was that the intention? What are these numbers for?
I would like to be able to estimate change in NPV like this. Is there any scope for changing QuantLib's behaviour here? Perhaps simply changing it is out for backwards compatibility reasons. But this could be controlled via a boolean option in the same way as includeSettlementDateFlows / includeReferenceDateEvents?