Improve error message in createWidget() (#12901)

Change-Id: If456a2be242754bcd1e0a8c5be00062a4355af35