The policy worked as expected. You are trying to save a task with a COMPLETED status. It satisfies the predicate condition you specified in the policy, so an exception occurs.
If you want to check the previous status value, you will have to reload the entity using the dataManager. You can get dataManager directly in the policy using applicationContext.getBean(DataManager.class).
However, please note that you will have an additional load from the database every time you try to save an entity. This is a bad practice and affects performance.
It would be better to set the check in the screen where the entity can be edited. You can immediately save the status value when opening the entity for editing. This way you will avoid additional data loading.
Also, if you are using the standard detail view, you can simply disable the detail_saveClose action using the condition in the enableRule action handler.