I can't pass a variable as parameter to a function

You’ve got too many brackets — try [.myfun<p>] instead.

Those Pesky Brackets is a good reference for when to use each type of bracket — but the super-short rule is that you should never be nesting them inside a filter.

:white_check_mark: tag[literal name of the tag]
:white_check_mark: tag<variable>
:x: tag[<variable>]
:white_check_mark: tag{!!fieldname}
:x: tag[{!!fieldname}]

(@Brian_Radspinner, I’m noticing that all your examples are things like <$list filter="[<stuff>]" /> — great as a minimal testcase! But it occurs to me that it might be useful to include things like <$list filter="[tag<stuff>]" /> as well, so it’s more obvious how variables/transclusions are intended to work with filter operators.)