I hate to be the bearer of bad news, but simply buying a house does not grant you a D visa or residency in Bulgaria. You still need a legal basis to stay, like being a pensioner, a company owner, or having a specific job. You should definitely look into
investing in Bulgarian real estate as a personal asset, but don't count on it as your ticket to a visa.