...I'm a software developer, re-using code and assets is what we do (when feasible). It makes zero sense to bin years of code when moving onto a follow-up project.
I reckon Kunos either:
a) Went back to AC1's engine and backported as much (non-proprietary) UE4 code from ACC as they could
Or b) Created a new engine from scratch*, porting whatever ACC code they were able to - which seems more likely to me IMO, due to
Stefano's alleged reaction to CSP (I'm 99% certain I've seen this post, but can't find it anymore)
I only have a small amount of game development experience (and that's using Unity, not UE), so I don't claim to be an expert. I'd love to see ACE's code behind the scenes, though I don't think there's much precedent of sim-racing developers doing that.
*Even then, I'm sure they re-used whatever they could - particularly physics code