The value of TextBox cannot be obtained and an error occurs
You are trying to access a member named query of your operator on lines 53 et 63, but it doesn't exist. Instead you want to access the property group you created in your register method : context.scene.QueryProps_query.query.
Side note : Don't use bpy.context in an operator, because it is not always the right context. (L.28) Use the provided context parameter instead.
import bpy

bl_info = {
    &quot;name&quot;: &quot;test addon&quot;,
    &quot;author&quot;: &quot;taichi suzuki&quot;,
    &quot;version&quot;: (1, 0),
    &quot;blender&quot;: (2, 80, 0),
    &quot;location&quot;: &quot;3DView&quot;,
    &quot;description&quot;: &quot;test addon&quot;,
    &quot;warning&quot;: &quot;&quot;,
    &quot;support&quot;: &quot;COMMUNITY&quot;,
    &quot;wiki_url&quot;: &quot;&quot;,
    &quot;tracker_url&quot;: &quot;&quot;,
    &quot;category&quot;: &quot;test&quot;
}

class QueryProps_query(bpy.types.PropertyGroup):
    query: bpy.props.StringProperty(default=&quot;aaa&quot;)

class TestAddon_PT_Panel(bpy.types.Panel):
    blidname = &quot;TestAddon_PT_Panel&quot;
    bl_label = &quot;TestAddon Panel&quot;
    bl_category = &quot;TestAddon&quot;
    bl_space_type = &quot;VIEW_3D&quot;
    bl_region_type = &quot;UI&quot;
    
    def draw(self, context):
        props_query = context.scene.QueryProps_query
        layout = self.layout
        
        row = layout.row()
        row.label(text=&quot;test textbox&quot;)
        row.prop(props_query, &quot;query&quot;, text=&quot;&quot;)
        
        vis_box = layout.box()
        
        vis_box.operator(TestAddon_OT_Operator.bl_idname,text ='modal start')

class TestAddon_OT_Operator(bpy.types.Operator):
    bl_idname = &quot;wm.modal_testaddon_operator&quot;
    bl_label = &quot;Modal testaddon Operator&quot;
    _timer = None
        
    def __init__(self):
        self.test = None

    def modal(self, context, event):
        if event.type in {'ESC'}:
            self.cancel(context)
            return{'CANCELLED'}

        if event.type=='TIMER':
            print(context.scene.QueryProps_query.query)

        return{'PASS_THROUGH'}

    def execute(self, context):
        wm = context.window_manager

        if TestAddon_OT_Operator._timer is None:
            TestAddon_OT_Operator._timer = wm.event_timer_add(1.00/60.00, window=context.window)
            wm.modal_handler_add(self)
            print(context.scene.QueryProps_query.query)
        
        return {'RUNNING_MODAL'}

    def cancel(self, context):
        wm = context.window_manager
        wm.event_timer_remove(self._timer)
        TestAddon_OT_Operator._timer = None

classes = (QueryProps_query,TestAddon_PT_Panel,TestAddon_OT_Operator)

def register():
    from bpy.utils import register_class
    for cls in classes:
        register_class(cls)
        
    bpy.types.Scene.QueryProps_query = bpy.props.PointerProperty(type=QueryProps_query)
    
def unregister():
    from bpy.utils import unregister_class
    for cls in classes:
        unregister_class(cls)
        
    del(bpy.types.Scene.QueryProps_query)

if __name__ == &quot;__main__&quot;:
    register()