hi there,
I had a similar issue and it also was solved with a pinch of magic ??
Problem is probably with invalid/expired direct link in post you’re editing (it’s saved in post table in database).
Whene you change custom post slug, permalink settings etc – link for post should be updated, but was not – 404 gone just after I clicked [Update] in (custom) post form.