Copying by-value for defer is bad design in-general; anything that exists in the same scope and cannot escape that scope (such as statement expressions, defer statements, and otherwise) should always refer to existing variables through their name and at the same location (address or whatever you want to call it in ${LANG}).
At the inverse of this, if your transportable function type/syntax refers to variables by-reference instead of copying them, I fucking hate you and your language/extension/compiler, and I hope your toolchain burns in hell.
(This is influenced by GC existence/general variable behavior, and similar shenanigans.)
My most-recent case of weird failure (during tests, thank God) was exactly this, a view that took a lambda that took a local by-reference[1], and then I passed the view out of the function that built the view because, hey, lazy evaluation right? Don't need the result yet, don't calculate it yet!
[1] Because that's always how I use lambdas (with <algorithm>) and I completely failed to consider how views change that up
(Mistake that is not caught by any flag I've found so far on gcc/clang, nor by /W4)