This is not what I meant. I meant that if you built and installed your own bindings and the paths inside config.py were different to the first time you did it (because the version of OpenCV you are using behaves differently to the latest one I am using) you could manually update the file with the same entries again because nothing else has changed. This is not necessary when you pip install.
cv2.cp312-win_amd64.pyd is just a wrapper around the OpenCV shared library stored in C:/Users/CompHub/Documents/Trace-master/Trace-master/OpenCV/build/install/x64/vc17/bin so this is unlikely. Are you using the prebuilt ffmpeg binaries now
-- FFMPEG: YES (prebuilt binaries)
or still providing your own? If your own how are you adding the path so that the OpenCV python bindings can locate them?
If this is the case it implies that the bindings were loading a different opencv_world.dll to the one you copied (again you can verify this with Process Monitor) are you still manually adding several build directories with the os.add_dll_directory command before import cv2? To clarify the version of opencv_world.dll and opencv_videoio_ffmpeg4xxx_64.dll you are using should be inside the C:/Users/CompHub/Documents/Trace-master/Trace-master/OpenCV/build/install/x64/vc17/bin directory and you should not be adding any other paths containing other versions of those files.