Stale element reference: element is not attached to the page document

Hi I am trying to run a test, but sometimes the test passes, and sometimes it gives me the Stale element exception “stale element reference: element is not attached to the page document”

I saw a previous article asking the same question, and the answer provided there was to update the Agent, which I have already done, but still getting the same error.

Can someone please help me with that.
TIA