There's nothing about AI that makes such operations intrinsically impossible, but they require much more than just the ability to generate working code.
Anything you don't define, is literally undefined behavior the same as in a compiler. The human will do something, and maybe you like it and maybe you don't.
A perfect spec is just another way to dedcribe a formal language, ie any programming language.
If you don't care what you get, then say little and say it ambiguously and pull the slot machine lever.
If you care what you get then you don't necessarily have to say a lot but you have to remove ambiguity, and then what you have is a spec, and if it's rigorous enough, it's a program, regardless what language and syntax is used to express it.
There is a difference between a human and an ai, and it is more than a difference of degrree, but filling in gaps with something that fits is not very significant. That can be done perfectly mechanistically.
Why do you think they would need a more defined spec than a human?