LF ideas - Buffs before the pull

Often, when someone uses a buff that increases your stats before the pull, then the log will display those buffed stats on your page summary page
eg. https://www.warcraftlogs.com/reports/2ZQmNc7aPdgb8nz3#fight=7&type=summary&view=analytical&source=2
https://www.warcraftlogs.com/reports/zhvCayWmHYKMxBZj#fight=1&translate=true&type=summary&source=8
I tried to check whether the buff expired before it was applied, but apparently it doesn’t always happen:
https://www.warcraftlogs.com/reports/r39mAxqfMBwC1XKZ#fight=2&view=analytical&type=summary&source=19
https://www.warcraftlogs.com/reports/cpYghjnd7AbXGztm#fight=11&view=analytical&type=summary&source=10

Does anyone have any ideas how to work around?

btw, I’m using api to do some queries and need the haste. Just looking for a way to detect whether the summary screen has been corrupted by these buffs and try to fix it.