According to Google NGrams, "lying in bed" is much more common.

"To lay" is a transitive verb. It can be reflexive - "I lay myself", "I am laying myself", "I was laying myself" - but it requires an object noun.

"To lie" by contrast is intransitive. It is an indicator of state, not action. Thus, your statement, which indicates your state in the past perfect, should use this verb and not "lay".

If "I was laying in bed", the connotation is that I was in the act of laying *something* in that bed, and the sentence is not proper unless that object is either stated explicitly or inferred by context; it can range from the innocent reflexive ("I was laying myself in bed") to the innocent transitive ("I was laying my infant daughter in bed") to the sexual ("I was laying my girlfriend in bed") to the absurd ("I was laying eggs in bed").