A wave selector expression with delay doesn't display correctly in right-to-left languages (like Persian) by default.
The only workaround I found is to make the copy layer . The expression written in the first layer is actually correct, but when it is placed in the composition alone, the expression value is not calculated correctly. However, miraculously, when a copy layer with the same expression and a different delay is placed in the composition in the visible state, the expression calculations for the first layer are performed correctly.
Create a copy of the layer and change the delay value in the copy. This will temporarily fix the issue. However, if you disable the visibility of the second layer, the calculations in the first layer will revert to the incorrect state