I faced this issue a lot, finally thought to make a forum post. In this game, when I reached the endgame, I just shuffled around with my pieces to not to get flagged. It was NOT a clear threefold repetition, but Lichess drew the game saying it was threefold repetition. I do not know whether this is a bug or not.
This topic has been archived and can no longer be replied to.