I hate how Node2D is scaling child nodes...
Create Node2D inside root Node2D, to new created Node2D attach GridContainer and then insert script (to Node2D), should look like this:
var viewport_size = get_viewport_rect().size
var grid = get_node("GridContainer") # change name to your GridContainer
global_position = Vector2(
viewport_size.x / 2 - grid.rect_size.x / 4,
viewport_size.y / 2 - grid.rect_size.y / 4
Check Xrayez answer, that should work better for you. Using my way you could make it centered if you add stuff to GridContainer in real-time and its size will change.