POSIX does not mandate
sed -i because it is redundant, and also not in line with the original purpose of
sed was originally meant to edit streams (hence its name
editor), not files. The correct tool in POSIX to edit files non-interactively is
printf "/text/d\nw" | ed file.txt
Sadly, many current systems think
ed is obsolete and don't provide it by default, even though it is mandated by POSIX... But at least it should be easily installable on most systems (unlike GNU sed, which might requre compilation from the source code).
EDIT: Also, contrary to what the wording of the question implies, the
d command of
(s)ed does more than deleting the given string, it deletes any line which contains it.