I recently ran into an issue when replaying an Oracle Tier 2 script.
I was executing a SELECT statement, but once I performed a SELECT statement that returned nothing, then it started returning 0 results from the lrd_fetch() after that. I investigated more, and discovered that if I use a string like xxxxxxxxx (length = 9) regardless of the validity, and then did a select for yyyyyy (len = 6) it would fail. Some how a longer string would corrupt the buffer, is what I thought.
I ended up finding the solution by digging through the vdf.h, which is generated automatically. The variable that bound my parameterized variable was defined with the DT_SF flag. This was the culprit and I had to change this to a DT_SZ (null terminated string). After this no matter how long my string was and whether it was valid or not I started getting the right results returned to me.
So, if you ever have odd issues with your SQL returns from lrd_fetch(), check out your vdf.h file and you might find the fix there.