I used to do the same thing with a full RPi4. I’m pretty sure that was the first non-pi zero that worked in gadget mode.
I was trying to make an attached Linux machine for my iPad instead of using a cloud VM. It was pretty effective, but at the time the ARM distributions were difficult to run what I wanted. Now, however, it would be significantly better.
Going in the other direction: recent Intel laptops with Thunderbolt should support USB gadget mode. In theory, this would allow a Linux laptop to emulate keyboard and mouse input to an iPad Mini portrait sidecar, with seamless kb/mouse context switching onto USB, as the cursor moved into the configured virtual viewport of the iPad "monitor".
Similar to synergy/barrier/input-leap, but using USB gadget mode instead of local network, since iOS wouldn't allow installation of non-Apple keyboard-mouse remoting software, https://github.com/input-leap/input-leap