Getting a single, random, related entry within a plug in
$matrixRow-&gt;relationshipField returns an ElementCriteriaModel pre-configured to query for the related elements. You can add / override additional criteria and then query for a matching element using the first() method.

$randomEntry = $matrixRow-&gt;relationshipField-&gt;order('RAND()')-&gt;first();


This is basically the same as what you’ve tried with your custom ElementCriteriaModel. It should also work once you have fixed the mistake in the relatedTo param, as the entry that holds the field is the “sourceElement” of a relation.