His teammate Sebastian Vettel had one lap earlier narrowly avoided the same wall.
Earlier on Kubica was coming through the castle section and clipped the inside wall before going on to hit the other side of the chicane front-on.
While they were all struggling with keeping their cars on the track Renault were battling for pace.
Daniel Ricciardo just got through the first session of qualifying, slotting into 15th before the session was red-flagged when Kubica put his Williams into the wall.
Ricciardo made it into Q2 by the barest of margins just crossing the line before the session was stopped.
His teammate Nico Hulkenberg was not so lucky.
The German was battling to get any pace out of the Renault, as was Ricciardo due to issues they were having with their brakes and the set up in regards to downforce.
"Just have a lack of confidence. I didn't really feel home and happy inside the car at any point this weekend," Hulkenberg said after his Q1 exit.
"On a track like this you start paying a big price. Missing P1, like everyone so it's not an excuse, hurt us more as we started a bit more out with the car set-up.
"We've been playing catch-up this weekend and haven't caught it.
"It's the first real hiccup this season where we've been off the pace. The comments of Daniel and me are similar, we're just looking for grip and can't really find it.
"Baku can be a crazy race and you've got to be in it to the end. Today isn't good but we'll race hard tomorrow."