@Simon Björkén Thanks for reaching out and apology for the inconvenience due to this issue.
As per the document I can see that currently logic app uses the DotLiquid 2.0.361 which was released on 6/24/2020 by Dotliquid as mentioned here. The where was implemented post 7th June 2021 as per this pull request at Dotliquid end so DotLiquid 2.0.361 doesn't support it. I will reconfirm with my team if the DotLiquid has been updated to any other version which supports where liquid filter.
I will keep you posted once I hear back from my team.
Update:
Logic app is still using the DotLiquid 2.0.361 and we will update our document once it is updated to the new versions.
The workaround would be leveraging the inline JavaScript function or offload this function to azure function and call azure function from logic app which will have your custom code for the transformation.
Please "Accept Answer" if the answer is helpful so that it can help others in the community.