Retrieve Matrix Field from Related Category in Element API
I've found a workaround for now. It's not ideal and I feel like it will probably be too intensive at scale but, for my uses, it will work.

Rather than using select() to reduce the data being returned from the initial query, I'm simply returning everything:

$related = Entry::find()
   -&gt;relatedTo($entry)
   -&gt;all();


I'm then looping over the returned object using foreach(), within which I'm dealing with the Matrix blocks in a seperate foreach(). At both levels I just pass back the data I want, something like this:

$reviews = [];
foreach ($related as $relatedEntry) {

   // Condense matrix blocks
   $critiques = [];

   foreach($relatedEntry-&gt;critique as $block) {
      $critiques[] = array(
         'title' =&gt; $block-&gt;seriesTitle,
         'copy' =&gt; $block-&gt;review,
         'date' =&gt; $block-&gt;date,
         'viewCount' =&gt; $viewCount,
      );
   }

   $reviews[] = [
      'id' =&gt; $relatedEntry-&gt;id,
      'slug' =&gt; $relatedEntry-&gt;slug,
      'title' =&gt; $relatedEntry-&gt;title,
      'critiques' =&gt; $critiques,
   ];
};



The output $reviews[] array is therefore equivalent to what I was doing with select() but not contains subarrays of my matrix field. Incidentally, I have managed to nest that one further with a SuperTable field within a matrix field. It needed another nested foreach() but it worked easily enough.

Once you have all of that, you can just pass it back to the endpoint like normal, so the whole thing (with above sections of code collapsed) looks like this:

'api.json' =&gt; function() {
   return [
      'elementType' =&gt; Category::class,
      'criteria' =&gt; ['group' =&gt; 'series'],
      'paginate' =&gt; false,
      'transformer' =&gt; function(Category $entry) {
         $related = Entry::find()
            -&gt;relatedTo($entry)
            -&gt;all();

         // Loop over related entries to extract just the information wanted
         $reviews = [];
         foreach ($related as $relatedEntry) {
            {...}   
         };

         return [
            'id' =&gt; $entry-&gt;id,
            'slug' =&gt; $entry-&gt;slug,
            'title' =&gt; $entry-&gt;title,
            'reviews' =&gt; $reviews,
         ];
      }
   ];
}


As I say, not ideal so I'm leaving this unanswered. If anyone has a more elegant solution I'd love to know.