Convert $ _GET to permalink

Probably the easiest way to solve this would be to add classes to your body tag based on the value of the parameter. You would just want to be sure to sanitize it. You can add classes to the body using the body_class filter which feeds in all the current classes as an array.

You might try something like the following at the top of your template file:

add_filter('body_class', function($classes) {
  if( ! isset($_GET['view']) )
    return $classes;
  
  $classes[] = "post-layout-" . esc_attr($_GET['view']);

  return $classes;
});

Now based on the body having a class of post-layout-list or post-layout-grid, you could style your posts list differently.

This has the advantage of less php logic to juggle. Note that this answer is meant to help think through the strategy, rather than as code that you can just copy and paste.