@Vance-Neff I’ve also had some surprising behavior when deleting or moving lines in macros.
I suggest you abandon this approach, and instead, use a regex F&R to match a complete line containing the term, something like:
^.*?YOUR_TERM.*?$
and then, make sure the Replace with field is properly empty (no spaces).
Use Replace a few times to satisfy yourself replacements are being done as expected, then Replace All to act on the whole file.