This seems to be a problem with imagick installation in your production server, because yii2-captcha prefers imagick when both imagick and gd are installed. Try uninstall imagick and see what happens. Will yii2-captcha work with gd?
And I think comparing the ‘php-info’ output of your production server with that of the testing server may help you spot the cause of the problem.