This is how I resolved the issue:
I was using the install_requirement.py in the dpethai repository, but it only installs the depthai 2.21.2.0 version. When I upgraded to depthai 2.22.0.0, it started working.
I did try uninstalling the opencv and PyQt5 and reinstalling them again, but it did not help in my case. When I am running cam_test.py, I am still getting the same error, but I am able to run depth map using OAK-D LR camera with the above fix.