The yii2-dynamicform plugin does not work when the yii2-widget-select2 plugin is dynamically added.

Modify the yii2-dynamic-form.js file. Starting from line 449, replace the code.

// "kartik-v/yii2-widget-select2"
var $hasSelect2 = $(widgetOptionsRoot.widgetItem).find('[data-krajee-select2]');
if ($hasSelect2.length > 0) {
    $hasSelect2.each(function() {
        var id = $(this).attr('id');
        var configSelect2 = eval($(this).attr('data-krajee-select2'));
        $(this).select2('destroy');
        $.when($('#' + id).select2(configSelect2)).done(initS2Loading(id));
        $('#' + id).on('select2-open', function() {
            initS2Open(id)
        });
        if ($(this).attr('data-krajee-depdrop')) {
            $(this).on('depdrop.beforeChange', function(e,i,v) {
                var configDepdrop = eval($(this).attr('data-krajee-depdrop'));
                var loadingText = (configDepdrop.loadingText)? configDepdrop.loadingText : 'Loading ...';
                $('#' + id).select2('data', {text: loadingText});
            });
            $(this).on('depdrop.change', function(e,i,v,c) {
                $('#' + id).select2('val', $('#' + id).val());
            });
        }
    });
}