I think it's unrealistic to build a cost-competitive open-source 2D printer. But it's relatively easy to just build your own printer. The parts that have the most R&D tied up in them (and so are unlikely to be replicated from scratch easily) are the inkjet heads and the ink's composition. If you can get those off the shelf then you can easily DIY everything else. There is a large existing industrial market for inkjet heads and ink. Many industrial inkjet heads are very easy to drive and have freely available data sheets. But they cost >$500 to a few $1k each and you probably want 4 for CMYK. I just built a custom printer in a few weeks for an art project with some of these (specifically, one called the Xaar128) driven by an RP2040. The experience definitely gave me a sense of awe and resigned respect for my humble desktop printer.
That's why I'm talking about a replacement motherboard for an existing consumer-grade printer (though not necessarily an inkjet one, I don't get it why people keep buying inkjet printers when they don't intend to print photos). Custom PCBs are very easy and cheap to get manufactured. All the maliciousness of these printers is in the firmware, and replacing the motherboard with an open-source one feels like the easiest way to get rid of that. The other possibility would be to write a custom firmware for the stock motherboard, but I'd imagine that printers these days would have some form of secure boot.