SAN FRANCISCO Next Tuesday here in California, 2.2 million people registered as "Decline to State" or nonpartisan voters will be eligible to cast a vote in the heated Democratic primary between Hillary Clinton and Bernie Sanders.

But because of the state's somewhat confusing rules for balloting, many of them will turn in ballots without actually casting a vote for either presidential candidate in the process--a quirk of the system that could end up costing Sanders votes he desperately needs to help him close the gap with Clinton.

Under California's election rules, nonpartisan voters can cast a ballot in the Democratic primary, but they must specifically request a Democratic ballot in order to receive one in the mail with Sanders' and Clinton's names on it. Those who didn't either request a Democratic ballot by Tuesday, May 31, or show up to vote in person on primary day and request a Democratic ballot there, are limited to voting in local races.

Get Breaking News Delivered to Your Inbox

What's more, once someone has turned in a ballot--even if they later realize it was the wrong one and didn't include presidential races--they can't fill out another one.

"Any of those Sanders supporters who are perhaps among those independent, non-partisan voters ... may be very unpleasantly surprised when they get their ballot," said Brian Brokaw, a Democratic consultant in California.

Public polling finds a margin-of-error race between Clinton and Sanders in the week before primary day in California: a Field Poll released Thursday put Clinton's lead at just 2 points, 45 percent to 43 percent. The results from a Wednesday NBC/WSJ/Marist poll were similar, with Clinton at 49 percent and Sanders at 47 percent.

Though Clinton is likely to mathematically clinch the nomination next Tuesday night, a come-from-behind win in California would be a big symbolic victory for Sanders that could give his campaign the data point it needs to justify staying in the race until the Democratic convention this July.

And for Sanders, the longtime independent Vermont senator whose electoral success has hinged in part on strong support from independent voters, California's ballot rules could deprive him of a swath of voters just when he needs strong numbers the most.

Absentee ballot data thus far shows that this is a legitimate issue: as of Thursday, just over 322,000 nonpartisan voters had turned in ballots for next Tuesday's primary, according to data from the California-based voter analytics firm Political Data Inc. Of those, though, just 125,000 cast their votes in the presidential primary--leaving just shy of 200,000 nonpartisan voters who sat out the presidential race entirely when returning their ballots.

Early exit polling conducted by Capitol Weekly found that 40 percent of nonpartisans who've already cast a primary ballot wanted to vote in the presidential primary, which would mean that almost 100,000 people who wanted to vote for either Clinton or Sanders didn't have the option. And asked about the issue in the exit poll, 60 percent of nonpartisan voters either thought they'd automatically receive a Democratic ballot or didn't understand the process.

"This is the mind-boggling, biggest story," said Michael Trujillo, a Democratic consultant who served as Clinton's field director in 2008. "If Bernie Sanders comes up short, you can literally count the number of ballots from people who wanted to vote for him but just didn't take the extra step."

Sanders pollster Ben Tulchin, who is based in California, said the ballot issues are "frustrating" but that they're not going to be what makes or breaks Sanders' chances at victory in California.

"Look, it's a challenge, but we've faced far larger obstacles in this campaign with voter access, crazy caucus rules--you name it," he said. "So I would say it's a bump in the road but the good news is, we had a lot of people who re-registered from Decline to State to Democrats."

In order to get ahead of the potential ballot issues, Tulchin added that the campaign encouraged many of its supporters to switch their party registration over to Democrat to ensure they received the right ballot initially. And Tulchin pointed to the 1.5 million new registered voters in the state this year, including large numbers of 18- to 29-year-olds, saying Sanders can find the supporters he needs among those groups.

Though Sanders' campaign thinks it can make up the numbers elsewhere in the California electorate, the issue is clearly on the mind of his allies: a group of them filed a lawsuit pushing the state to extend the registration deadline until primary day because of the confusing rules.

A federal judge ruled against the suit in a hearing Wednesday, saying California voters are "smart enough to know what their rights are."

Paul Mitchell, vice president of PDI, said it's unlikely that the ballot rules will be the single factor that swings the election in Clinton's favor, but it could impact the overall delegate counts for both candidates.

"It's not a winner-take-all state, so it's not like 10,000 or 20,000 votes is going to mean all the delegates in California," he said. "But we could find that certain congressional districts, a delegate here or a delegate there, could be impacted by this."

Mitchell said much of the confusion results from the fact that California has switched to a nonpartisan primary process in which candidates from all parties are on one ballot and the top two finishers, regardless of party, advance to the general election. That system is in place for all races besides the presidential level, so this confusion now only arises once every four years.

Ultimately, the biggest takeaway from California's ballot issues is that the process needs to be changed next time around, Mitchell added.

"This is a black eye on our process," he said. "My real fear is ... that there are going to be tens of thousands or hundreds of thousands of voters who feel that they had a right to participate but something in the process failed them."