The reason in the workmanager itself. I just replaced it with compute and it doesn't cause freezes anymore.
workmanager
compute