wixData.insert(...) Race Condition?

Is the wixData vulnerable to race conditions? Here’s the scenario:

MembershipRepositoryTests.jsw
export async function Test_DeleteMember_SuccessfulReturn() {
let member = TestUtil.nonexistentMember(“SomeSalt”);
let created = await memberRepo.createMember(member)
.then(m => memberRepo.deleteMemberProfile(m._id));

Assert.isNotNull(created);
}

MemberRepository
export async function createMember(memberProfile) {
const result = await wixData.insert(C.TB_MEMBER_PROFILES, memberProfile);
return result;
}

export async function deleteMemberProfile(id) {
let deletedMember = await wixData.remove(C.TB_MEMBER_PROFILES, id);
return deletedMember;
}

This test (and other similar tests) fails about 1/5 of the time. Is this improper usage of the API? Or is it unsafe to create an object and reference its ID immediately after inserting?

Also note, if I sleep the await the thread for 500ms, no longer fails periodically:

const sleep = delay => new Promise(resolve => setTimeout(resolve, delay));

Running the tests today, I suspect the issue was actually with Wix’s rate limiter. Our tests weren’t prepared to correctly log these issues.