Works now also with patches transformator. If you use patches9602 transformator, you will get this warning:
# Warning: 'patchesJson6902' is deprecated. Please use 'patches' instead. Run 'kustomize edit fix' to update your Kustomization automatically.
kustomization.yaml
patches:
- target:
group: kustomize.toolkit.fluxcd.io
version: v1beta1
kind: Kustomization
name: name-i-dont-want
path: patches/kustomization-managed.yaml
patches/kustomization-managed.yaml
- op: replace
path: /metadata/name
value: name-i-like
Thanks to @Mafor for the initial solution! My version is just an update, using kubectl v1.27.0.