I created this Duplo compatible jail cell so the kids could put the bag guys in jail. In features a lose fitting, removeable top for loading in the the bad guys. The default model in the .3mf is 6x6 duplo pegs, and you can customize this using the included OpenSCAD *.scad file to make it other sizes and adjust the number of bars on the length and width to make the jail as tight or loose as you would like.
In this build, the jail bars are printed as part of the duplo connection point base and then the top frame is glued on. I left a good amount of gap in the indents on the top frame to make it easier for things like hot glue. You may be able to adjust this so you have a friction grip and will not need glue. I also printed the main base with a raft because of adhesion issue on the first few builds.