The best way is with epoxy glue mixed with fine sawdust from the same timber.
fill all the holes
To effectively use nails for wood in your DIY project, follow these steps: Choose the right type and size of nails for your project. Pre-drill pilot holes to prevent splitting. Hammer the nails in at a 45-degree angle for better grip. Use a nail set to countersink the nails below the surface. Fill the holes with wood filler and sand for a smooth finish.
I am busy chinking all of the holes in the dam breast, right now.
I used plumber's putty to fill the holes. It stays soft and maleable. That might work for you too. Plumber's putty will not allow you to paint or stain. If you need either of those abilities you need to use a latex exterior wood filler/putty or a urethane based caulk that stays flexible and is paint and stain accepting. You can also use wooden dowel rods, found at hardware and home improvement stores, cut to length (approximately 3/4 inch long) with wood glue to fill simple holes.
Spackle or joint compound is commonly used to fill holes in walls.
If the box itself is broke, you will need to repair it with screws, nails, glue, whatever it takes to hold it together. Then you will need to use the equipment needed to mount it to the wall (screws, nails, etc.) making sure that these pieces are not broken as well. If the holes in the wall have gapped, it will either need to be repositioned or you will need to fill in the holes and start over.
Holes don't fill things up, they empty it
Fill them up again.
Spackle or joint compound is the best material to use to fill holes in a wall.
Bondo.
It is called the "Swim Bladder".
To install quarter round trim, measure and cut the trim to fit the length of the wall, then nail it in place using finishing nails. Make sure to angle the nails slightly to secure the trim properly. Fill any nail holes with wood filler and paint or stain the trim as desired.