Pass node id to custom access denied panel page and/or view pane
I found a solution that works.

I've just changed the default value of the view's contextual filter to PHP code and added this:

$node_path = explode('/', drupal_get_normal_path(trim($_SERVER['REQUEST_URI'], '/') ));
return $node_path[1];