I don't blame CarMax either, just more of a statement of fact that it can be an inherent challenge of buying vehicles from places like that, where service records are typically incomplete, if available at all.
That being said, if sludge in the engine is the extent of the issues with that vehicle, it would stand to reason that replacing the engine would be the fix. If the previous owner took it to their local Infiniti dealership to have it serviced while they had it, perhaps a trip to your local dealer would be in order to see if service records carry over and all Infiniti dealers have access to see what service was done at any other location. At least you could get a feel for what other issues, if any, have been looked at and fixed on this specific vehicle. And for a vehicle as new as yours, if they never took it to a dealer for much of any service at that point, I would probably go another direction because it's hard to say what other issues their lack of maintenance will cause down the road. I feel like if the previous owner either leased or bought that vehicle, they should have taken it to the dealer for most of their maintenance since it would have been under original warranty, presumably. So if they can't pull up many or any service records, YIKES