Praise be to Allah.
Yes, it was narrated in Sahih al-Bukhari (581) and Sahih Muslim (831) that it is forbidden to pray after Fajr prayer until the sun has risen above the horizon to the height of a spear, at the time of noon when the sun is at its zenith, and after the time of ‘Asr until the sun is fully set.
The Prophet (peace and blessings of Allaah be upon him) told us that the sun rises and sets between the two horns of a devil, at which time the unbelievers prostrate to it.
Shaykh Sa’d al-Humayd:
“There is nothing in the hadith to say that the jinn pray to the devils at that time, rather the devils (shayatin) are the evil ones among the jinn.”
And Allah knows best.