There's an episode of Love, Death and Robots called Zima Blue, where a robot that scrubs the tiles on the side of a swimming pool is progressively upgraded over many years by engineers until it becomes a fully conscious android. It then obsessively pursues the meaning of life through ever larger art projects, some reaching planetary scale. It eventually concludes it has found the meaning of life and in it's final art project it disables all it's higher cognitive functions and "downgrades" itself back to it's original tile scrubbing form with just enough awareness left to take pleasure in the singular menial task.
EDIT: I just found out it was adapted from a book called Zima Blue and Other Stories by Alastair Reynolds