SVG Helper not working on live server

Using the SVG helper to render a logo which works fine locally but not on my VPS (CentOS 7, Apache, PHP 7.2). I’m rendering it with the following…

<?php
  $logo = $site->sitelogo()->toFile()->mediaRoot();
  $logoalt = $site->sitelogoalt()->toFile()->mediaRoot();
?>

<?php if(!$page->isHomePage()): ?>
  <a href="<?= $site->url() ?>"><?= svg($logo) ?></a>
<?php else: ?>
  <a href="<?= $site->url() ?>"><?= svg($logoalt) ?></a>
<?php endif ?>

Is there anything wrong there? Does the helper depend on anything special, like php extension that might be missing?

I’ve had strange issues before with case sensitivity, maybe ->mediaRoot() is returning something it doesn’t like. Everything is lowercase though, so i’m not convinced that is the issue. It’s not even rendering the tag, nothing is getting rendered at all, just the anchor tag.