Remove Patient from service queue throws error 400 and 500

I have no progress.

Per suggestion, I created a thread that addresses only one problem. If someone can give guidance on that one?

https://talk.openmrs.org/t/patient-duplicated-on-the-service-queue-buttons-not-working/