If you're pretty sure that you're going to lose a demurrer to your complaint -- perhaps the tentative is against you? -- and you want to voluntarily dismiss the complaint without prejudice instead, be sure to do so before the hearing starts. Because once it has started, the "trial" has "commenced" and you no longer have the unfettered opportunity to dismiss.
At which point, if you're right, you'll really lose. With prejudice.