The world number 140 shocked Djokovic at the ATP 500 event, which the Serb accepted a wild card for.
The Serb's form since the Australian Open has been horrendous, with first-round exits at both Indian Wells and the Miami Open in March.
Who could be the next first-time No. 1 in 2023?
There was an improvement with the arrival of the clay-court season, despite the recent split with coach Andre Agassi, as Djokovic made it to the third round in Monte Carlo, only to lose to Dominic Thiem.
But the result to Klizan sets his preparations back for Roland Garros, which starts on May 21.
"I feel I haven’t lived up to your expectations, not even my own," Djokovic told a news conference.
"It’s hard to deal with these types of games and defeats, I wasn’t playing at my best, only during the second set. I will try to continue and see where it takes me."
Favourite and 10-times champion Rafael Nadal eased past fellow Spaniard Roberto Carballes-Baena 6-4 6-4 in his first appearance at this year's tournament to reach the third round and set a record by winning 38 consecutive sets on clay.
World number one Nadal, who also had a bye to the second round, packed out the main court at the Real Club de Tenis in Barcelona which is named after him.
Perhaps still feeling the effects of his triumph in Monte Carlo on Sunday, Nadal made a slow start against Carballes-Baena and was broken in the opening game to fall 2-0 behind.
The Mallorcan responded by breaking twice to take a 4-2 lead and went on to claim the first set. Nadal broke in the opening game of the second set but lost his serve in the sixth.
He went in front again and had match point at 5-3 but could not take advantage, although he comfortably closed the match out with his next service game.
"It was a difficult game and I committed a couple of errors at the start. The first game here after Monte Carlo is always hard but I soon found my rhythm," Nadal told reporters.
The victory saw the Spaniard surpass Romanian Ilie Nastase's record of winning 36 consecutive sets on clay in 1973.
Kei Nishikori retired during his opening match against Spain's Guillermo Garcia-Lopez after experiencing pain in his right wrist.
The 28-year-old, who lost to Rafa Nadal in the Monte Carlo Masters final on Sunday, withdrew after losing the first set 6-3.
"My expectations grew in Monte Carlo, despite losing to Nadal," Nishikori told reporters. "However, I started feeling discomfort again during the first set and I did not want to take any risks."
The Japanese missed last year's U.S. Open and the Australian Open at the start of 2018 after injuring the same wrist in August.
Second seed Grigor Dimitrov eased past Frenchman Gilles Simon 6-2 6-1 to book a place in the last-16.
Additional reporting via Reuters
Nadal answers GOAT question and identifies his most 'important legacy'
Australian Open
Five burning questions with 50 days to go until 2023 Australian Open