Fetch RGB/hex values of object's material color for all frames where shader nodes have been used

I need help to fetch RGB values of object material for all the frames where shader nodes have been used to change colors. I’m not able to fetch values with scripting by using bpy.data, materials['material1'].node_tree.nodes['separate RGB'].outputs

This is the blender animation

Some experienced people have told me that-

you can’t read shader node output data with python but you can try to bake though

if you need the output of a node, sticking it into an emission node and baking it is an option

but I am not familiar with these techniques, can anyone please have a look of this blender animation and help me finding what can be the optimum solution to achieve this or is it even possible to do it from the way this animation have been designed?

For baking, you need to use Cycles.
In your case, as you just want the color, you should plug the color directly into the material output, and bake the emission channel.
The target image could be just a 1*1 pixel image, which will make the process faster.
Also, doing this with a simple plane (with the same material and a copy transforms constrain) will be simpler, and the engine will only need to store 2 triangles.
You also need a script to bake the animation… a pseudo code would look like this:

colors =[]
for frame in range(1, bpy.context.scene.frame_end + 1):
    color = Color(bpy.data.images['baked_target'].pixels[0:3])

You should read the manual on how to setup everything.