This could be scripted and not really be that complicated. Remember that what you want to change is on frame 0 only. On frame 0 you can move points and bones without fear of anything changing. What I mean is, if you move the bones of a parent bone layer the exact same amount as the child layers points they will line up as before and it will work the same.
The trick here would be to get just the transformation x and y of the top layer that needs changing (z doesn't effect points). Find the value needed to set this to 0. For example; parent or sub layer is set to -0.3 x and you need it to be 0, you would need to move the layer +0.3 to be zero again. Once then you would have to move the points of each layer -0.3 to get those layers back to where they were when the layer was translated.
So imagine all of the switch layer vector layers have different shapes and bounding areas. You need to, select all the points, get the position of that point group, then add or subtract the layer translation value to that point group position. Doing this would put the points in the exact position they were in when the layer was "moved" but now is at zero (I do this by hand all the time).
Layer scaling and z translation are going to be a completely different situation. If you have a sub switch layer with scaling that needs to be "reset", and you need to maintain that size, you would have to scale and offset the bones keeping the locations. Then of course scale the point groups. I have a script I use occasionally to scale bone rigs using a percentage, but it actually simply duplicates the rig to another bone layer. I would need to modify this script to scale the existing bone rig.
Scaling the points in a relative matter is another issue because point scaling scales from the center of the bounding box of the points. This could cause some layers to change position or move incorrectly because the bounding box of the points could be quite different on each layer.
When I do this by hand I create an unfilled "box" that is larger than all of the points of each layer. I paste this box on each layer creating a new bounding area for scaling that is identical for all layers so that scaling is simple and keeps the points in the same position since they now have the same bounding box dimensions and will scale the same way. I actually will leave that unfilled box on the layers just in case I need to do this again in the future.
Everything I described above is actually not that complicated from a scripting point of view. It probably doesn't require using any matrices or global transforms at all because the goal is to set the "global transform" to zero anyway, and changing the regular point locations to match the original value. All pretty straight forward "addition and subtraction".
I have several scripts that individually do some of these things already. The tricky part would be hooking them together to do the whole thing with a click or menu script. The hardest part would be scaling. The translation is actually pretty easy.
The other tricky part would be z translation. If the z of a sub layer is not 0 then the "perspective" scaling is different. So to zero that out you would also need to do some scaling. However, I have yet ANOTHER script that does that as well for a completely different purpose. I could add that in to reverse compensate the z translation. Layer rotation zeroing might be quite tricky if needed. This would require the "bounding box" trick as well, for rotating the points in the exact same spot for each layer. The main problem here would be the rotation center point. The layer origin is used for layer rotation. The bounding box of the points is the origin for point rotation. This could get tricky. A workaround would be to create or modify the bounding box for the layers so that the center origin point of the box is on the layer origin point (I have also done this by hand on several occasions).
I have thought about scripting this process... but... in reality I do this "by hand" only occasionally when I have scaled sublayers like switches, and want to "zero" everything as you described. The "by hand" process doesn't take long for me depending on the number of layers to modify... it's just tedious and requires using a calculator (to calculate the sublayer translation of points)

I weigh the time it would take to script this against the time it takes to "do it by hand" every once in a while.
The key to avoiding this situation (which doesn't help you at all in this case) is to try and keep layer transformations to a minimum during character creation and rigging. This is something I learned over the years which is why I don't have to deal with it.
However, in your description this could be a situation with two different complete character rigs that need to be "zeroed" out to work inside another bone rig.
My one question is what sort of scripts on the parent bone rig don't compensate for layer transformations? I don't know exactly what they do but it would seem to me to be a simpler process to modify a layer script to compensate for layer transformations so that all of the other stuff doesn't need to be done anyway.
Sorry for the long post. When I get some free time I could try to work on this or hopefully some of the information is what you need to script this yourself? Wasn't sure what you needed, scripting info or a script.
