Problem on wpdb queries, wp_insert_post, wp_insert_user etc. The query runs twice

I resolved my similar issue (see below code block) by modifying the path to wp-load.php. Actually I used Frankie Jaret’s uri parse script which really only works on the default install but, meh, that’s what I use. I’m sure you can find a function that will parse it out where ever it may reside. Code below

$parse_uri = explode( 'wp-content', $_SERVER['SCRIPT_FILENAME'] );
require_once( $parse_uri[0] . 'wp-load.php' );

I don’t know if this will help you out but it solved the issue for me.

Similar Issue: I realize this isn’t an answer but I can’t make a comment since this is my first post and I have 0 rep. But I have this exact same problem I just started to see it recently and have no favicon issues as I run the insert from a cronjob. I’ve been able to replicate it at least 30 consecutive times today. I will post the answer once I’ve figured it out. But I do know for a fact only the specific number of post arrays are being passed yet it still creates two posts, or customs in my case.