Why the Bresenham's algorithm does not work for those two points?
Like Rahul said that algorithm is only in the case where $0 \lt \Delta y \lt \Delta x$. 

So you need to adjust the coordinates to fit within that. 

There are 8 cases:


$0 \lt \Delta y \lt \Delta x$ the normal base case
$0 \lt \Delta x \lt \Delta y$ swap x and y except for the drawPixel call.
$\Delta x \lt 0 \lt \Delta y$ and $|\Delta y &lt; \Delta x|$ use case 1 but negate $\Delta x$ and instead of counting from x0 to x1 you count from x1 to x0
$\Delta x \lt 0 \lt \Delta y$ and $|\Delta x \lt \Delta y|$ use case 2 but negate $\Delta x$ and instead of counting from x0 to x1 you count from x1 to x0


The remaining cases have $\Delta y \lt 0$ so swap the 2 points and it will fall within the previous 4 cases.