How to get block layout programmatically?
You can get the block layout programmatically from the configured blocks by going through each region defined in the current theme:

  $block_layout = [];
  $theme = \Drupal::theme()-&gt;getActiveTheme();
  $regions = $theme-&gt;getRegions();
  foreach ($regions as $region) {  
    $blocks = \Drupal::entityTypeManager()
      -&gt;getStorage('block')
      -&gt;loadByProperties(['theme' =&gt; $theme-&gt;getname(), 'region' =&gt; $region]);
    uasort($blocks, 'Drupal\block\Entity\Block::sort');
    $block_layout[$region] = array_keys($blocks);
  }


This is without checking if the blocks are visible on the front page. That would be difficult, because the visibility condition plugins are context aware and only provide a correct result when they are called in a real front page context.