A small detail in Star Wars: Episode III – Revenge of the Sith suggests that Palpatine toyed with the idea of killing Anakin—before he had fully seduced him to the dark side. Ever since meeting the Chosen One in The Phantom Menace, Palpatine molded Anakin into his idea of the perfect apprentice. Given that Anakin was immensely powerful with the Force, Palpatine knew that he would be an essential piece of his master plan to rule the galaxy. In Palpatine’s mind, having Anakin by his side was his final blow to the Jedi. Even so, he was wise not to hang his entire plan on whether Anakin turned.
https://screenrant.com/palpatine-kill-anakin-skywalker-revenge-sith-detail/