Potentially these code snippets in usd-qtpy
here may guide you along:
Note that these will start changing PrimSpec
opinions across the layers, and hence may influence many layers - potentially spanning across layers, references, payloads, etc.
More details on Editing Prim Specs where answered on the forum here and in the past I’ve faced some issues with batch namespace edits in variant sets which you may be useful background info if you run into crashes.