The thing is that Rowling hadn’t really thought it through yet. Having the hero save a slave is pretty clearly heroic and good, and it’s a nice way to wrap up the Dobby story arc, but then the fans were all like “wait WHAT!? there’s slaves under Hogwarts!?” and she was forced to think it through, and it turns out JK’s pretty awful so the result of her thinking it through was to make it worse.
This is true of the consumer market, but the OP asked about governments, and 90% of government computers in China run Kylin or NeoKylin, with plans to consolidate the two into a single os. This follows the overall trend of China’s tech sector seeking to replace imports (and copied versions of foreign tech) with fully domestic alternatives.