Lightmap pack - UV unwrap (python error)

Hi, so I want to unwrap the UV (using lightmap pack) of the model, but it says this error.
Here’s a thing, I’ve made a model, appended 2 simple materials, then I’ve unwrapped the first with the lightmap map option (it worked properly), but when I do exactly the same process it didn’t work.
(Only the color is changed)

The error:

Python: Traceback (most recent call last):
File “C:\Program Files\Blender Foundation\Blender 3.1\3.1\scripts\startup\bl_operators\uvcalc_lightmap.py”, line 693, in execute
return unwrap(self, context, **kwargs)
File “C:\Program Files\Blender Foundation\Blender 3.1\3.1\scripts\startup\bl_operators\uvcalc_lightmap.py”, line 578, in unwrap
lightmap_uvpack(meshes, **kwargs)
File “C:\Program Files\Blender Foundation\Blender 3.1\3.1\scripts\startup\bl_operators\uvcalc_lightmap.py”, line 292, in lightmap_uvpack
pretty_faces = [prettyface(f) for f in face_sel if f.loop_total >= 4]
File “C:\Program Files\Blender Foundation\Blender 3.1\3.1\scripts\startup\bl_operators\uvcalc_lightmap.py”, line 292, in
pretty_faces = [prettyface(f) for f in face_sel if f.loop_total >= 4]
File “C:\Program Files\Blender Foundation\Blender 3.1\3.1\scripts\startup\bl_operators\uvcalc_lightmap.py”, line 133, in init
self.uv[i][:] = ((co.x - xmin) / xspan,
ZeroDivisionError: float division by zero

location: :-1