@Korina I have the exact same problem, and it is also a realme phone that I have.
Like others before me, I don't have the problem on a Xiaomi running Android 11. On the realme on Android 12, however, the problem is EXACTLY as already described in this thread.