We did this switching between a input voltage and ground to create an ultra-precision voltage divider without precision components, patented long ago (5030848). More recently used to create a precision square-wave for DMM AC calibration switching between a reference voltage (5.000VDC) and ground. As mentioned paralleling a bunch of ordinary CMOS gates works well, as does using a discrete PMOS and NMOS to make a CMOS discrete inverter. Most CMOS gates do not have an equal valued Ron to VDD (PMOS) and Ron Ground (NMOS), the NMOS is usually lower. If this matters you can add a small "equalizing" resistor in the CMOS ground path, or use a discrete version like we did with the square-wave DMM calibrator, use PMOS and NMOS FETs that have equal Rdson at the same magnitude Vgs.
Best,
Edit: Here's an image of the DMM calibrator using the CMOS switching concept, the discrete NMOS and PMOS SOT devices forming a CMOS inverter are under the large electrolytic capacitor.