transform.rotation
is not an Euler angle triplet. It is a quaternion. So its z component is not a rotation angle that you can pipe through Quaternion.Euler
meaningfully.
If you want to apply only the roll of one object to another, you can do something like this;this:
child.transform.rotation = Quaternion.LookRotation(Vector3.forward, transform.up);
This forms a rotation whose forward direction maps to world forward (so 0 pitch / yaw), and whose up direction is as close as possible to parallel to your reference object's up vector when using roll alone.
Or to roll it in the opposite direction, take the Quaternion.Inverse
of the above.