Hindsight's a bitch.Knowing now that the initial pace wasn't there I think the undercut still may have been possible pitting 3-5 laps later. If so, that slight wait would have been ideal as Ricciardo would have had something left at the end to challenge for P9/10 instead of dropping back with off tyres.
With the benefit of hindsight, he would have been better off waiting those 3-5 laps, and wouldn't have been caught on dead rubber at the end of the race.
Without the benefit of hindsight, he found himself unable to get past George Russell, on tyres which were going bald. He thought there would be greater pace in a new set of tyres, which would allow him to do the undercut. I think at that stage they were still expecting to go to slicks at some stage before the end of the race too, so he wasn't expecting to run to the end of the race on that 2nd set of intermediate wets.