Bot sometimes does not identify UI elements

I developed a bot that perform various click based actions on desktop application as well as on website. It is working fine but sometimes the bot fails to identify some of the buttons as well as links and stops execution at that point. But when I restart the bot, without making any changes, it runs smoothly again. Can anyone please suggest me how this is happening?

Usual case here would be that your selector for those buttons & links changes everytime. It should be dynamic enough enough and consistent. Did you check if that?

Rammohan B.