I'm running a multi-language setup and this snippet:

always returns an array for me, which results in the error.
My language file looks like this:
<?php
return [
'code' => 'en',
'default' => true,
'direction' => 'ltr',
'locale' => [
'LC_ALL' => 'en_US'
],
'name' => 'English',
'translations' => [],
'url' => '/'
];
Although I tried the following and it didn't work as well:
<?php
return [
'code' => 'en',
'default' => true,
'direction' => 'ltr',
'locale' => 'en_US',
'name' => 'English',
'translations' => [],
'url' => '/'
];