Tente, primeiro reformate a matriz de origem como abaixo:
$result = array();
foreach($depots as $depot){
$result[$depot->operating_company_name][] = $depot;
}
Então, para criar a tentativa de seleção,
<select name="depot_id" class="form-control">
<?php foreach($result as $key=>$val): ?>
<optgroup label="<?php echo $key; ?>">
<?php foreach($val as $option): ?>
<option value="<?php echo $option->depot_id; ?>"><?php echo $option->depot_name; ?></option>
<?php endforeach; ?>
</optgroup>
<?php endforeach; ?>
</select>