The second source example is وَيُعَلِّمُهُ الْكِتَابَ. In connected recitation, the lām of the article is sākin after the elided hamzat al-waṣl, so the hāʾ is followed by a sākin sound and receives no ordinary ṣilah.
Decide by what is actually pronounced during connection, not only by the presence of a written alif.
Opening interactive controls...
No regular ṣilah before a sākin sound
Rules of Hāʾ al-Ḍamīr: Vowels, Ṣilah and Exceptions
The second source example is وَيُعَلِّمُهُ الْكِتَابَ. In connected recitation, the lām of the article is sākin after the elided hamzat al-waṣl, so the hāʾ is followed by a sākin sound and receives no ordinary ṣilah.
Decide by what is actually pronounced during connection, not only by the presence of a written alif.