sudo chown "Operation not permitted" - how to resolve permissions to allow chown by admin or root users?
Try either or both of these commands:

sudo chflags noschg '/path/to/file.ext'

sudo chflags nouchg '/path/to/file.ext'