I removed all the $scripts class calls, because makegrid and sql both the JS were already called in header class file hence I removed the call to the header class, and all it's scripts and just called the JS files directly, I could also just remove the last two calls,

$scripts->addFile('makegrid.js');
$scripts->addFile('sql.js');
and add them using global..