If you have an expression using an implicit this in a closure, then the closure has first to find out what this actually means. Your line bar=foo is actually <this>.bar=<this>.foo, with <this> being the implicit this. To resolve this "with" tries first the delegate, which is the object you use "with" on. In this case here we have a map for this and a map will always return a value, regardless for what key you ask. It wil return null in that case. Since the map responds to everything the <this>.bar=<this>.foo will be controller.params.bar=controller.params.foo - leading to the wrong result for you.
The solution for you is now to qualify and go away from the implicit this and use and explicit one: bar=this.foo
So this is not a bug, it is how the scoping rules in Groovy work in combination with maps.