These models do have some form of understanding though. There are features for bugs and typos, and general features that map descriptions and pieces of code. It understands the code in so far it helps with next token prediction.
The bigger problem is that these language models are inherently unreliable and stochastic in how they generate. You request a feature - and it destroys something else in the process - because a single incorrect prediction caused it to diverge and skip a portion of the original code. You request a small modification - and it decides to restart from scratch - because random sampling made a different way of doing something more likely rather than what was there already. Errors compound and the model has no way of fixing or correcting them.