BMesh and boolean operation I create a BMesh using some vertices like this:

def create_object(self):
    # Create a mesh and an object and 
    # add the object to the scene collection
    mesh = bpy.data.meshes.new("MyMesh")
    obj  = bpy.data.objects.new("MyObject", mesh)

    bpy.context.scene.collection.objects.link(obj)

    bpy.ops.object.select_all(action='DESELECT')

    bpy.context.view_layer.objects.active = obj
    obj.select_set(state=True)

    # Create a bmesh and add the vertices
    # added with mouse clicks
    bm = bmesh.new()
    bm.from_mesh(mesh) 

    for v in self.vertices:
        bm.verts.new(v)

    bm.verts.new(self.vertices[0])

    bm.faces.new(bm.verts)

    bm.to_mesh(mesh)  
    bm.free()


    bpy.context.view_layer.objects.active = obj
    obj.select_set(state=True)

    bpy.ops.object.editmode_toggle()
    bpy.ops.mesh.select_all(action='SELECT')

    bpy.ops.mesh.remove_doubles()

    # set origin to geometry
    bpy.ops.object.editmode_toggle()
    bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY')


This creates a simple object with a face. Then I extrude it in edit mode and do a bool (diff) operation with it, which leads to distortions when I do a bevel operation afterwards.

Here is he created object:



And I do a diff bool after that to a cube and then bevel an edge



Any ideas what is wrong with the BMesh?
Ah got it, the normals were inside after extrude, didnt see it for I was in eevee render and no normals overlay activated:-)