Material Instance parameters to Material Layer Instance parameters and back?

Hello all, So I have a library of material functions that output material attributes and various instances of said materials. Basically like the new material layer system they have and i started converting them over to that since 4.26 is around the corner. So far I’ve been manually recreating the layer instances to match the material instances. Does anyone here know of a way, if it is possible, to copy all the parameter names/values of the material instances and set them in the Material layer instance since they have the same parameter names, and vice versa? Or maybe a point in the right direction?

also using 4.25 if it matters