Studies of the effect of having a pet on owner loneliness scores report very mixed results with the more recent (and usually better quality) research reporting little to no impact of pets on human loneliness. This would appear to fly in the face of the self-reported experience of pet owners.
Herzog, Harold, Can pets relieve loneliness in the age of the Coronavirus? 2020. Animals and Us Blog Posts, Psychology Today, 13 April, 113. https://www.psychologytoday.com/us/blog/animals-and-us/202004/can-pets-relieve-loneliness-in-the-age-coronavirus