It's obviously not universally true of magic, obviously, but a fantasy novel that treats acts of magic as provable and repeatable and consistent in the manner of science does not make it a science fiction novel.
And on the other hand there are scientific novels where what is going on surpasses the comprehension of the characters. Solaris is mostly about the entire scientific process being confounded by the unpredictability of a single planet.
Your examples are spot on on the differences between science fiction and fantasy - one has an element of the supernatural and one mostly does not.
However, there is one good example of cross over. Star Wars while mostly viewed as science fiction has the element of fantasy in the force. The force being an inherited characteristic that gives them their powers.
But isn't the same true in Harry Potter
because the magicians have also a inherited triat
that gives them the magic gift over the muggles.
So had Harry conjured himself up a Star Ship to hide from Lord Voldatmort would that have made Potter partially sci-fi?