If my character is on top of or holding (not necessarily grappling) on to a creature or object when it undergoes a polymorph effect to turn into something much larger like an elephant or a large tree, could my character remain on top of, or holding on to the top of, that polymorphed creature or object?
I think this would be completely up to the DM, system-independent. If you hold on to a tree branch and the tree is polymorphed into, say, a giraffe, where does the tree branch go? Does it become a leg? Does it get incorporated into the giraffe's torso, robbing you of a hold?
On the other hand, standing on top of a stone that get's polymorphed into an elephant might require you to make a saving throw against falling off the expanding and potentially wobbly elephant that forms beneath your feet.