> the patch should probably only substitute the namespace field specifically
That's a flaw, but probably not the most critical one. Avro identifiers cannot contain dots except in namespaces. So as long as the package name contains a dot (which most do) then the global replace should not harm the schema. Fixing this requires a fair amount of code, walking the schema and creating a copy with things renamed. (We already do this in a few places, so probably we should create a SchemaVisitor API to simplify this, but that's a separate issue.)
Note that this approach will always be flawed, since it won't always be able to perfectly reconstruct the relocations used when shading. However replacement is only attempted when things are already broken, so it does no harm and imperfections are thus tolerable.
Probably the biggest flaw of the current patch is that it will fails if nested schemas are not all in the same namespace. To address this we might look for a common suffix or prefix in the new and old package and then replace the differing text. For example, if the current class is com.baz.hidden.org.foo.Bar and the schema is org.foo.Bar then the replacement should be to prefix all namespaces with com.baz.hidden.
I'd be happy to see such improvements to this patch, but I'd not object to it being committed more-or-less as-is since it does no harm.