Trouble accessing a multidimensional array to add classes to default WordPress widgets

The problem isn’t how you are accessing the array, as you put it. It is with the str_replace line. That generates bad markup. You are replacing class=" with your classes, so <aside id="whatever" class="abc"> becomes <aside id="whatever" full-blocks">. That is just wrong. Try:

$params[0]['before_widget'] = preg_replace('/class="([^"]*)"https://wordpress.stackexchange.com/", 'class="'.$class.'"', $params[0]['before_widget']);

That should give you valid markup. I have concerns about completely replacing those classes. I’d consider adding to them instead. That is a pretty simple change:

$params[0]['before_widget'] = preg_replace('/class="([^"]*)"https://wordpress.stackexchange.com/", 'class="$1 '.$class.'"', $params[0]['before_widget']);

Notice the $1 right after the class=" in the replacement string.