I think google do not devalue the links from .edu and .gov sites because google may know how difficult that links to get from. Only a few of the sailers sail to the shore and get those links. .edu and .gov websites do not allow the other participant to get backlink eaily.
It is not about edu or gov, it's about the relevance. .Edu is good for edu site. For business, .com is the best. You may use ahref to check backlinks of WHT to see the natural distribution (60% com, 9.6% net, 0% edu, 0% gov): https://ahrefs.com/site-explorer/ove...ostingtalk.com
Page rank, domain authority, relevancy stands for all website whether it be .com,.gov or any other main domain. So just buying from any gov or edu site is not an achievement from any standard, but getting from a reputed site from where you get regular visits must be your target.