Weak aura progress bar is increasing the maximum time of moonfire with nature's balance. Anyone know how to work around this issue?

Here's what I have in my duration trigger so far

Code:
function()
    local _, _, _, _, _, duration, exp = UnitDebuff("target", "Sunfire")
    
    local dur= exp - GetTime()
    
    if dur > 0 then
        return true
    else
        return false
    end
end
However, when I leave combat it stops working. I assume the UnitDebuff function doesn't pass information when out of combat. Also, the "PLAYER" flag in UnitDebuff doesn't seem to work either.