How to wrap field out put in custom markup?
Might be misunderstanding but it sounds like you just want a #prefix and #suffix on the base render element:

function bootstrap_modal_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
  $element = array(
    '#prefix' =&gt; '&lt;div class="wrapper"&gt;',
    '#suffix' =&gt; '&lt;/div&gt;',
  );

  ...