Given RAW unlimited retries, barring some game element preventing it, the rogue will eventually roll a natural 20. That means that absent any pressures, if the lock is equal to or less than 20 + Thieves' Tools/Slight of Hand bonus, the DM should skip the roll and narrate an eventual success...