As far as I know, there is nothing that prevents working with (importing from) both repositories.
There's probably a good reason for that, you know?
You solved it by mixing openzeppelin-contracts-upgradeable
v4 and v5?
Not a good idea, see this answer (and there are probably a bunch more around this issue).