I am currently trying to run a function that I developed and described in this post. Unfortunately, the error is very difficult to reproduce. I continue to receive an error