The top object rotates around it’s up axis as expected.
The bottom object rotates so that it’s up axis changes. I don’t understand why. I expect it to rotate around the local UP axis. I know that transform.up is the local up axis in world coordinates so I think it should work.
You got something fundamental wrong here. Quaternions actually don’t specify an “absolute” rotation but a relative. Unity simply defines the default orientation as z=forward y=up and x=right.
When you use Quaternion.AngleAxis you create a “relative rotation” which can rotate a vector or a coordinate system from an initial state by that relative amount. However you don’t do a relative rotation but you set the “global” rotation of the object to that rotation. So you basically rotate the object from it’s initial (0, 0, 0) state by the relative amount which is not what you expect.
To rotate the current orientation by that relative amount you have to multiply the current rotation by that relative amount: