Short description of error
Vertex group weighting does not carry over to the resulting mesh after Object.to_mesh() is called on an object with modifiers.
Exact steps for others to reproduce the error
Open the example blend:
Run the script and observe the terminal output that shows each vertex of the resulting mesh has no groups assigned.