I wish I had more information to give, but I came across something similar. I tried loads of stuff and eventually settled on using DISM instead of wimlib in the capture script.
Dism /Capture-Image /ImageFile:"$imagePath\part$($partition.PartitionNumber).winpe.wim" /CaptureDir:"$($updatedPartition.DriveLetter):\" /Name:"part$($partition.PartitionNumber)" /Compress:fast > x:\wim.progress 2>>$clientLog
I also added integrity checks to the script since I was running into a (probably?) unrelated issue with the number of snapshots my VM had that was leading to a mismatch between the expected hash and the actual hash when running wimlib-imagex verify. (The solution to that was to export to a new VM so the snapshot chain integrity was well)
The code above is not a direct replacement; I don't recommend overwriting your capture script unless you want the tech debt. I'm sure there is a more sane approach. This is just what I came across.
Edit, thank you @theopenem_admin for making the scripts accessible and centralized. You could have easily baked them into the WIE builder but had them downloaded as resources at runtime instead and that's awesome.