Why do I get this error when I save my custom field?
Use the Json class in core, it’s set up to use associative arrays (rather than the default object from json_decode, which is causing your current issue):

$decoded = \Drupal\Component\Serialization\Json::decode(...);