I have my doubts that Larian built a game with D&d 5e rules as written (in entirety), and then spent time changing the code again to be more like D:OS2.
They did not, but they also made and are making substantial changes - it is not the same engine that run D:OS2 - that should be obvious just comparing them side by side. And considering how much stuff they add and change, I don’t think “engine doesn’t support it” is a reason for anything.
They clearly do want to keep many things from D:OSs - that is creative choice however, not an engine limitation.
I suppose an odd quote is this:
We took the D&D fifth edition ruleset, we ported it to video game format, and we saw the things that didn't work.
I wonder what form it took - did they added functionality to their D:OS engine? Or did they created basic prototype in which they can mess around with stuff? You hear stories about devs prototyping ideas within days to prove a concept - they might have tested potential implementations without going full in and building proper framework for it. I doubt there is another build of BG3 with faithful 5e implementation, but that doesn’t mean that what they said is a lie.