As seen in #29075, unexpected failure while generating the code for a value is missing context. Looking at BeanDefinitionPropertyValueCodeGenerator, we could build a nice context using nested cause to show exactly what the original value was.