List of selected faces after shortest_path_select()
Unclear what the issue is.
Will mention that when a mesh is put into edit mode, the edit mode mesh is a &quot;snapshot&quot; of the data when mode toggled.  It is not written back to the mesh datablock until mode is toggled back. (Or other methods are called to implicitly save edit mode changes)
&gt;&gt;&gt; C.object.update_from_editmode(
update_from_editmode()
Object.update_from_editmode()
Load the objects edit-mode data into the object data

Hence looking at bpy.data.meshes[&quot;Foo&quot;] data while &quot;Foo&quot; is being edited will not show updates.
Little test script.
import bpy
import bmesh

ob = bpy.context.edit_object
me = ob.data
bm = bmesh.from_edit_mesh(me)

def print_selection(element_type):
    selection = [e.index for e in getattr(bm, element_type)
                 if e.select]
    print(f&quot;{len(selection)} {element_type} selected&quot;)
    if selection:
        print(f&quot;    {selection}&quot;)



print(&quot;Before&quot;)
for sel in (&quot;verts&quot;, &quot;edges&quot;, &quot;faces&quot;):
    print_selection(sel)
bpy.ops.mesh.shortest_path_select()
#bmesh.update_edit_mesh(me) # Not required.
print(&quot;After&quot;)
for sel in (&quot;verts&quot;, &quot;edges&quot;, &quot;faces&quot;):
    print_selection(sel)

Run on default grid.

Output to console
Before
8 verts selected
    [11, 12, 21, 22, 77, 78, 87, 88]
8 edges selected
    [6, 29, 31, 32, 139, 155, 157, 158]
2 faces selected
    [10, 70]
After
28 verts selected
    [11, 12, 21, 22, 23, 31, 32, 33, 42, 43, 52, 53, 54, 55, 62, 63, 64, 65, 74, 75, 76, 77, 78, 84, 85, 86, 87, 88]
40 edges selected
    [6, 29, 31, 32, 34, 48, 50, 51, 52, 53, 69, 71, 72, 88, 90, 91, 93, 95, 107, 109, 110, 111, 112, 113, 114, 130, 132, 133, 135, 137, 139, 149, 151, 152, 153, 154, 155, 156, 157, 158]
13 faces selected
    [10, 19, 20, 29, 38, 47, 48, 49, 58, 67, 68, 69, 70]

Again with two initial verts selected

Before
2 verts selected
    [11, 88]
0 edges selected
0 faces selected
After
15 verts selected
    [11, 12, 13, 14, 24, 34, 44, 45, 46, 56, 66, 76, 86, 87, 88]
14 edges selected
    [6, 9, 12, 35, 54, 73, 76, 78, 96, 115, 134, 153, 156, 158]
0 faces selected

And again, but modifying to also show the mesh selection, deselect all verts, toggle into object mode and back to edit mode, select two verts and  run script
def print_selection(element_type):
    lut = {&quot;verts&quot; : me.vertices,
           &quot;edges&quot; : me.edges,
           &quot;faces&quot; : me.polygons,
           }
    selection = [e.index for e in getattr(bm, element_type)
                 if e.select]
    print(f&quot;{len(selection)} {element_type} selected&quot;)
    if selection:
        print(f&quot;    {selection}&quot;)
        
        print([lut[element_type][i].select for i in selection])

Result.
Before
2 verts selected
    [11, 88]
[False, False]
0 edges selected
0 faces selected
After
15 verts selected
    [11, 12, 13, 14, 24, 34, 44, 45, 46, 56, 66, 76, 86, 87, 88]
[False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
14 edges selected
    [6, 9, 12, 35, 54, 73, 76, 78, 96, 115, 134, 153, 156, 158]
[False, False, False, False, False, False, False, False, False, False, False, False, False, False]
0 faces selected

What is the bmesh equivalent to bpy.ops.mesh.shortest_path_select()?