Looking at the source code for the bag_to_pcd node, the file names are constructed using the timestamp of the point-clouds in the bag file. It's possible that the Livox mid-40 lidar driver you're using isn't adding the timestamp to the topic, which would result in the same file 0.000000000.pcd1 being overwritten repeatedly.
rostopic echo /livox/lidar --noarr

If you see the timestamps are always zero then you've confirmed this is the problem. If so the first thing to check is if there is a way to get the driver to start publishing this information. If not you'll have to either add artificial timestamps yourself, or modify the bag_to_pcd node.