This problem is discussed in #39999; sorry. The error is caused by MacOS using BSD sed, which requires a mandatory argument of a zero-length string to the -i option to edit a file in-place, whereas Gnu sed has an optional argument to the -i option to edit a file in-place. The different syntax causes the "file not found" error.
wlh