If they are actual booleans already (and not a string value like ‘yes’ ‘no’ or ‘true’) then you don’t need to use the bool filter at all and it can be simplified to:
when: var1 and var2 or not var3
Regarding the logic, what does debug say the variable values are before the task you’re using them in with the when statement above?
Thanks guys for looking into it. With some debugging it came up that one of the variables was never set and was always false, so another case of stupid user error. Otherwise can confirm that the condition works as expected with or without |bool, which I guess has higher importance when used with vars as {{ var | bool }} format.