My guess is that you’re trying to remove something that is actively in use or the RPM is being managed by something else (eg You have Software Manager open while you’re trying to remove something using zypper).
You have to determine what is currently managing the file.
If it’s an application, stop the application first before removing.
If it’s a fundamental system object, then more details are needed.
Could also be a hung process or something else.
If all fails, try rebooting and trying again.
If it’s still a problem after rebooting, then that’s a clue the managing process is something started on boot and then you’d have to inspect the process more closely.