Assymetrical model with same number of vertices in each side - how to transfwer weights?
Object Mode Version

Here is a test script to run in object mode. It looks for all vertex groups on active object that end with ".L", finds a matching group ending with ".R" (or None).

Then using the list comprehension methods from Python - Finding Vertices in a Vertex Group check if there are the same number in each.

If so, for each left group vert,  sort the verts in the right group by the distance from the x mirrored location left group vert. Pop off the closest and set to mirrored pos of left.

Requires no operators and no edit mode.

import bpy
import re

context = bpy.context
ob = context.object
# get the mirrored name
def get_mirror(g):
    return ob.vertex_groups.get(re.sub(r'(.*)L', r'\1R', g.name))

mirror_groups = [(vg, get_mirror(vg)) for vg in ob.vertex_groups
        if vg.name.endswith(".L")]

for lg, rg in mirror_groups:
    if rg is None:
        print(lg.name, "has no mirror group")
        continue

    print(lg.name, rg.name)

    lverts = [v for v in ob.data.vertices 
            if lg.index in [vg.group for vg in v.groups]]  
    rverts = [v for v in ob.data.vertices 
            if rg.index in [vg.group for vg in v.groups]] 

    if len(lverts) != len(rverts):
        print("mismatching vert counts", len(lverts), len(rverts))
        continue 

    for lv in lverts:
        vec = lv.co.copy()
        vec.x *= -1
        # sort rverts by distance from lvert
        rverts.sort(key=lambda v: (vec - v.co).length) 
        # pop and set the rvert
        rv = rverts.pop(0)
        rv.co = vec 
        rg.add([rv.index], lg.weight(lv.index), 'REPLACE')