How is your Pi connected? Wifi? Wired?
That error looks like something is going severely wrong with the server response in transit. OctoPrint will return an HTTP 200 OK with a JSON body on profile modification, and a HTTP 204 No Content with an empty body on profile deletion. Both are perfectly valid and standard compliant HTTP responses.
I also just tested this... fresh install, created a bunch of new profiles, edited one, deleted another, reset the default profile and so on:
All working as expected, so whatever it is, it is something in your environment, though I'm currently at a loss as to what. If you are connected via wifi I'd suggest to check via a wired connection. Next step would be to deploy something like wireshark or tcpdump or Charles Proxy to get an idea of what's actually going over the line...