Render whole entity inside a controller
You can do that by setting a variable in your controller or in template_preprocess_teacher in your .theme file, like:

function template_preprocess_teacher(array &amp;$variables) {
  $classrooms = $variables['elements'][0]-&gt;get('field_classrooms')-&gt;referencedEntities(); //probably a bit different for paragraphs ..

  foreach($classrooms as $classroom) {
    $variables['classrooms'][] = \Drupal::entityTypeManager()-&gt;getViewBuilder($classroom-&gt;getEntityTypeId())-&gt;view($classroom, 'optional-view-mode');
  }
}


And then access it in twig like this:

{{ classrooms }}


If you're looking for a twig only solution use the twig_tweak module, then it comes down to this:

{% for field_in_paragraph in teacher.field_classrooms.entity %}
  {{ drupal_entity('classroom', field_in_paragraph.value, 'optional-view-mode') }}
{% endfor %}