How to create a flat mesh and give it a thickness by bmesh?
I tested the script and it created some additional geometry, so i added these two lines

for face in bm.faces:
    face.normal_update()


before calling the bmesh operator and it worked for me