RouteNotFoundException thrown when trying to reroute
These are the routes for content entities in a drupal standard install:

 entity.block_content.canonical                        /block/{block_content}
 entity.comment.canonical                              /comment/{comment}
 entity.contact_form.canonical                         /contact/{contact_form}
 entity.menu_link_content.canonical                    /admin/structure/menu/item/{menu_link_content}/edit
 entity.node.canonical                                 /node/{node}
 entity.taxonomy_term.canonical                        /taxonomy/term/{taxonomy_term}
 entity.user.canonical                                 /user/{user}


In this list the route parameter names are in {}. Put the parameter name as key in an array:

$route_parameters = ['node' =&gt; $nodeid];


Don't send the response, return it:

return $response;