Estimation that is based on Story points is pretty unreliable, but still the Scrum team should complete a Sprint backlog on time - isn't it a flaw in the Scrum process?
A Sprint Backlog is a Forecast and it can change as part of the sprint when the Development team uncovers more about the work to be done. There is no explicit expectation that the Development Team will always deliver it's forecast or that the forecast can't be changed.
As part of the Daily Scrum:
The Development Team or team members often meet immediately after the Daily Scrum for detailed discussions, or to adapt, or replan, the rest of the Sprint’s work.
We also expect teams to become better at slicing their work, at delivering more frequently (even multiple times per sprint) and at dealing with unforeseen complexity. Yet, highly advanced teams will encounter unexpected things and it may happen that you don't deliver what you had planned. That's part of life. Scrum can't change that.
As others have said, relative estimation (story points) is not an essential feature of Scrum, it just happens that relative estimation works very well with an iterative approach to delivery. The principal reason for agreeing estimates during Sprint Planning is to decide which stories can fit into the current sprint - that is all. So estimates don't have to be very accurate, they just have to be accurate enough to determine when the sprint is full.
With a new team or when working with a new kind of problem or technology you may find that estimates aren't very accurate. The team's ability to estimate will usually improve however. As the team becomes more practiced over successive iterations they should get better at estimating things and so the velocity should settle down into something more predictable. Past velocity is used as a guide during Sprint Planning to decide when the sprint is full.