Midrash

Midrash is a scriptural relevant explanatory story. Doctrine can not generally be drawn out of Midrash (but it may help in understanding verses otherwise in the dark).

The reason doctrine can not generally be drawn out of Midrash is because any important doctrine would have been made clear in the Torah or the ketuvim, etc.

Midrash is scriptural and referenced twice in the Hebrew Scriptures:

From this we know that the midrash are loosely authorized by scripture as “background information” which is not necessarily important enough to include in the main text.

One must be clear on the point that midrash can never over-ride a plain reading of scripture. Again, if doctrine was intended to be taught from a midrash it would have been written in as part of the canonized scripture and not passed down as background information.