Right now it doesn't make much sense the way you putted.
Well this is just my speculation
What I mean is the ancient robot set a mission for himself to protect the Noah Ark, it's a parallel to Kuma volunteer to help Strawhats by protecting their ship until they return during the timeskip. So the ancient robot tried to protect whatever Joyboy had left behind.
200 years ago, the mermaid princess which was also the Poseidon at that time probably wondered around the sea forest and stumbled upon the ancient robot. The ancient robot knew she was the Poseidon because he was part of Joyboy crew (if he was part of the crew). The robot develop a friendship with the Poseidon, can be strong relationship like Kuma and Bonney.
When the Fishman attends the reverie with Poseidon, the Celestial Dragon wants to capture her make her their slave. The same thing happened at the reverie not long ago. While the Poseidon screams for help, the Ancient Robot sensed it and go to help protect her. It can be a parallel with Kuman and Bonney.
I have said the "mind = power" in my theory post. I guess he failed to save Poseidon and her death led to him losing his mind, thus losing his power.