Attaching library to form isn't working
Those two statements are not equal.

$form['#attached']['library'] = array('somelibrary');

Resets the library array to only contain "somelibrary".  This would remove anyone else's library that may need to get loaded.

$form['#attached']['library'][] = 'somelibrary';

This adds "somelibrary" to the existing libraries array for inclusion. (this is correct)

$form['#attached']['library'][] = array('somelibrary');

This is the wrong structure.

For Drupal 8

$form['#attached']['library'][] = 'somemodule/somelibrary';