I have identified the root cause of the problem I am encountering. When setting the “itemreceive” line field to “false,” I set the values of the other line fields as well, as they are included in the data. The exact reason for this behavior is unclear, as there is no error message indicating the cause. However, when I modify the values of the other line fields, the line is prevented from being deleted.
Solution: To remove a line from an item receipt, set the value of the “itemreceive” field to “false” and refrain from modifying the other line fields in the same line; otherwise, it won’t work.