They ran it through the dealerships scanner, which “they said” was the #5 lifter..;
So from the stuff I’ve seen, the scanner is probably just indicating misfires on cylinder 5. There might be some other codes, but I wouldn’t expect them to cause the engine to run rough.
Obviously there are a whole host of things that can cause the symptoms you have given, one being the lifter. Enough said about having that fix done versus replacing the engine. I assume your good on maintenance and as such replacing an engine would be the last thing I’d do. I’d try to trade it or something before I did that. But I’m still gunshy from a failed engine replacement in my youth that resulted in paying for a engine I didn’t own and my first time leasing, lol.
I stumbled across a post about a cracked insulator on a plug causing a misfire and rough condition at idle, and smooth running at speed. Of course this was on cylinder 8, which if you have ever done plugs on these can be a royal pita to remove or to insert, and it was after a fix for...wait for it...a bad lifter and bent pushrod. It was tiny crack I guess, probably happening during the install.
I also read about one doing a similar thing where it was a dirty intake. Guy seafoamed the engine and it went away. Now I have never seafoamed an engine as I have always been nervous about it, but ymmv on that. It might be worth a conversation with a different shop or a local mechanic if you have any.
I’m interested it what the codes say. My money is on misfires and probably some oxygen sensor type stuff. I’d concentrate on the misfire stuff. The obd dongle I have allows you to use an app called “torque” iirc. I think it might have to be side loaded though, but you can set it up and kinda watch for the misfires and stuff happening real time, which is similar to what the dealers scan tool does. I haven’t used mine in years because I’ve switched to Ford for the last few and they have been leases, so always under warranty. And I have iPhone now which seems to suck for these kind of things. But if it’s still around on android it’s a pretty helpful app.