Call a function with parameters on a certain frame
Return a callable
Please read the handler docs https://docs.blender.org/api/current/bpy.app.handlers.html A handler method takes two arguments the scene and the depsgraph. You append a function to handlers. In above update is a callable function whereas update(foo) is the result of calling that function, which without a return, returns None by default. Explaining error message.
That covered, using a method similar to answer here
Handler-script updates in viewport but not in render
Recommend passing the name rather than the object , otherwise object removal may cause null reference issues.  The object is fetched from the scene objects collection by name in the handler.
Q code
import bpy

def update_text(name, old_text, new_text, key_frame):
    def handler(scene, depsgraph):
        text_ob = scene.objects.get(name)
        if not text_ob:
            return
        f = scene.frame_current
        text_ob.data.body = new_text if f &gt;= key_frame else old_text
    return handler


def register(update):
    bpy.app.handlers.frame_change_post.append(update)

# while testing to avoid buildup
bpy.app.handlers.frame_change_post.clear() 
# update text content
register(update_text(&quot;Text&quot;, &quot;old&quot;, &quot;new&quot;, 10))

Am currently using 2.90alpha and this is updating both in viewport and when rendered. Will find some issues with earlier versions of 2.8 not updating in render.
Check out the answer in link above re using a text data block as input using line numbers as frames.  Instead of replacing body on each line could append or hold forward if a line is empty. (eg for example &quot;old&quot; on line 1, and &quot;new&quot; on line 10.

import bpy

# pass arguments to build a handler
def text_body_handler(text):
    lines = len(text.lines)
    # the handler method
    def text_body(scene):
        f = scene.frame_current
        text_ob = scene.objects.get(&quot;Text&quot;)
        if text_ob and f &lt;= lines:
            body = text.lines[f-1].body
            if body:
                text_ob.data.body = body

    return text_body

bpy.app.handlers.frame_change_post.clear()           
bpy.app.handlers.frame_change_post.append(text_body_handler(bpy.data.texts[&quot;Text&quot;]))

Related
Updating text object in Blender 2.81 using python
Note also:  Avoid mixing context with handlers. It may be the case that the scene being &quot;handled&quot; is not the context scene. (bpy.context.scene)  perhaps given a bit of a bum steer by answer in Q link..