This should actually be replicatable with stock XF behavior.
XF has the option "Delete IP usage data after", which defaults to a year. This will leave a dangling xf_ip.ip_id reference on the xf_post/xf_thread tables. So if a moderator edits a thread title of an old enough thread this error...