Yes. Functional expansion for meta arguments is still a bit of a mess. I’m working on a new code base for code expansion. This can be a nice test case. For now I’d use a helper predicate …
BTW, I absolute love dictionaries. They are a huge advantage over having to have a structured term where all arguments are by position. This created enormous hassles in refactoring code in the past. Well done on the innovation!