helmut2509's post in strange error in index.php was marked as the answer
I think I've discovered the cause of the error:
in a custom script I commented out this:
$config = wire('config');
...and the the error did not occur any more.
But I am sure it worked also fine with this command enabled.....
But obviously this command is not necessary if $config is declared as 'global' in the functions?!?