Handle errors in select2 initialization

The following discussion from !24727 (merged) should be addressed:

  • @filipa started a discussion: (+4 comments)

    should we add a meaningful message for sentry to catch these errors?