A car with a rebuilt engine is just as good as a car with a new engine as long as the rebuilt engine was completely rebuilt with all new parts including valves, lifters etc.
When a cars engine is completely rebuilt all new parts are usually put into the engine and then the engine basically becomes brand new except for the engine block and heads.
When I rebuild an engine it gets all new parts including the pistons, oil pump, timing chain etc so basically when I rebuild an engine the engine has 0 miles on the engine even though it's went a lot miles before the rebuild.
So the engine that has been rebuilt in the vehicle has less miles on it than car actually has.
So a properly rebuilt engine is perfectly fine and just as good as a new engine.