The hadith you are referring to is narrated by 'Aasim through Al-Sha'bi through 'Abdullah ibn Mas'ood. Al-Sha'bi did not meet 'Abdullah ibn Mas'ood, so the chain of narration is severed, and the hadith is weak.
The hadith is quoted in multiple books as:
:روينا من طريق الشعبي أنه قال: قال عبد الله بن مسعود
من قرأ عشر آيات من سورة البقرة في ليلة لم يدخل ذلك البيت شيطان تلك الليلة، أربع من أولها، وآية الكرسي، وآيتان بعدها، وثلاث آيات من آخرها
:وفي رواية
لم يقربه ولا أهله يومئذٍ شيطان، ولا شيء يكرهه، ولا يقرؤه على مجنون إلا أفاق
— NOTE: My own translation, so treat with care:
We were told through Al-Sha'bi that 'Abdullah ibn Mas'ood said:
Whoever recites the following ten verses of Surat al-Baqarah at night, the shaitan will not enter his house that night: the first four verses, the verse of al-Kursi and the two verses after it, and the last three verses.
In another narration:
No shaitan will approach him or his family that night, nor anything that he hates; and if recited to an insane person, that person will be cured.
First, the hadith is mawqūf on 'Abdullah ibn Mas'ood, i.e., it is not attributed to the Prophet ﷺ.
Second, Al-Sha'bi is 'Aāmir ibn Shuraḣīl ibn 'Abd, who did not narrate through 'Abdullah ibn Ma'ood.
Therefore, the hadith is mursal (severed chain), i.e., weak.