Our minivan was a similar story. We bought a '17 Odyssey in 2020 with 193k on it (not a misprint). I ran the math, and where we got it, it was a solid deal where we could afford to replace one major component (engine or transmission) and still be ahead of the game compared to a lower mileage one. And if I needed to replace something, it was going in a late model car, not one of my ancient clunkers. Plus, owning something that's already taken a major depreciation hit limits the potential future loss from a depreciation perspective.
It had no records with it, but was in excellent shape, likely used as an airport shuttle for three years and traded in. I figured if someone relied on it for income, they likely took care of it. I did the timing belt right away (again, no records), along with some other maintenance stuff. Started driving it in earnest, and it started flashing transmission codes. Took it to the dealer we bought it from, and they replaced the transmission with a used one that slipped from the get go. Took it back to the dealer, and after a fight, they put in a second used transmission. It was a fight, but all of this was covered by the state-mandated used car warranty.
After the second transmission replacement, I was tempted to call the experiment a failure and cut bait. But I figured that I could still replace a major component and come out ahead. So I've done some preventative maintenance (replaced the radiator, transmission lines that had been leaking, installed an aftermarket transmission cooler, changed the AT filter, and perform regular drains/fills of the ATF), and just started driving it (albeit with a tote full of tools and a good scanner in it).
Long story short, I've built some confidence in the car that I formerly didn't trust and life is better. We've taken it down to FL with the entire family and all our gear, and it handled it with ease. I have enough cash parked in my emergency car repair fund that if something major goes south, I'm covered. Did the Blackstone Labs oil analysis on the motor, and it came back clean.
I'd have an oil analysis done on your truck to see if it picks up anything obvious, and go from there. You're probably frustrated between your dealer experience and the repairs it's needed, so sometimes it helps to take a step back and assess the entire situation. In my case, it was worth it to roll the dice for an amount of time to see how it worked out.