It's correct for the first example. By default, a static route has a preference of 5.
However, you are altering the default setting for the static routes anc configure a preference of 10.
The qualified next-hop has a pref of 6 and it's chose as next-hop.
In the second example, you are using the default settings for static routes(preference of 5), which is higher than 4, the preference of the qualified next-hop, so the qualified next-hop is used.
=====
If this worked for you please flag my post as an "Accepted Solution" so others can benefit. A kudo would be cool if you think I earned it.