How do you programatically set grid scale?
The error message is trying to inform you that the property lookup &lt;screen&gt;.overlay was unsuccessful, because that's not where that property is located (the tooltip is misleading..) . It's something you might want to iterate through screen area.spaces to locate and set. It's a little awkward, but acceptable.

import bpy

AREA = 'VIEW_3D'

for window in bpy.context.window_manager.windows:
    for area in window.screen.areas:
        if not area.type == AREA:
            continue

        for s in area.spaces:
            if s.type == AREA:
                s.overlay.grid_scale = 2
                break


or..

import bpy
for area in bpy.data.screens["Scripting"].areas:
    if area.type == 'VIEW_3D':
        for space in area.spaces:
            if space.type == 'VIEW_3D':
                space.overlay.grid_scale = 2
                break