Thanks for the patch! There was already an issue submitting a fix for the bug ( https://www.drupal.org/project/insert/issues/3265233 🐛 Notice: Undefined index: drupalExternalPlugins in insert_editor_js_settings_alter() Fixed ), so closing this issue as duplicate.
As for CKEditor 5 compatibility, the Insert module is not compatible to CKEditor 5 at this point. There is a separate ticket addressing that circumstance: https://www.drupal.org/project/insert/issues/3314446 📌 CKEditor 5 compatibility Active .