Speculations as to why pigs rather than cows form part of the character meaning home comes from some misunderstandings about the characters. Specifically,
「家」 contains 「豕」 as a corrupted phonetic component rather than a semantic component;
「牢」 did not originally contain 「宀」, which is a corruption of a drawing of an animal pen.
Shuōwén's explanation of 「家」 is very close, and it traced the source of the phonetic hint of the character correctly.
「家」 (Baxter-Sagart OC: /*kˤra/, home/dwelling) was originally comprised of semantic 「宀」 (building) and phonetic 「𢑓」 (also /*kˤra/). In the character 「家」, 「𢑓」 was very early on corrupted into 「豕」, leading on to the modern form.
「𢑓」 (male pig) was originally a picture of a pig 「豕」 with an emphasised reproductive organ, and this word is now written as 「豭」. The glyph evolution compared with 「豕」 is as follows:
Yes, Shuōwén is a source of some egregious graphical corruptions, and it simultaneously remains as one of the most important sources of modern character standardisation. It is a good starting point for character analysis that shouldn't at all be relied on.
「家」 means dwelling, and is comprised from semantic 「宀」 and abbreviated phonetic 「豭」.
correctly determined the vocabulary source of the phonetic hint, but did not correctly determine the actual character representing the vocabulary source.
The other explanations which interpret 「豕」 as a semantic hint are (in my opinion) rather far-fetched, although these explanations will pop up everywhere in more conservative accounts of the character. At the very least, the non-association of characters for non-pig animals with the character for the meaning home/dwelling strongly suggests the importance of the phonetic role of 「𢑓」.
Finally, 「牢」 did not originally contain 「宀」.
The original character was a picture of an animal pen, and sometimes, 「羊」 (sheep), 「馬」 (horse), or 「牛」 (cow) was added to the character:
The form with cow is the shape which has survived ...
... and the animal pen component was later corrupted into 「宀」 (building).