How to display the rendered entity of the "compact" display of the user account in the profile?
If I understand your question correctly, you want to change the view mode when a user's profile page is displayed. I recommend to put this kind of logic in a module, not in your theme. One way to do this, is by implementing the hook_entity_view_mode_alter(&amp;$view_mode, Drupal\Core\Entity\EntityInterface $entity, $context):

function YOUR_MODULE_entity_view_mode_alter(&amp;$view_mode, Drupal\Core\Entity\EntityInterface $entity, $context) {
  if ($entity-&gt;getEntityTypeId() == 'user') {
    $view_mode = 'compact';
  }
}