All that travel in 7 days is unwise. Too much time going from place to place to place. Boppard and Frankfurt are two hours + apart by train. Munich and the Bavarian "castles" (presumably Neuschwanstein and Hohenschwangau) are separated by 2.5 hours by train and bus. You save .5 hour by driving between these places, but only if you get in and out of Munich and Frankfurt with no traffic issues. So you can't stay in just 2 places and hit all your destinations without lengthy day trips, whether by car or by train. And you also have lots of ground travel between the Frankfurt/Rhine area and the Munich area as well. Your best bet is to pick either the Frankfurt/Rhein area or the Munich area; find 2 base towns in one or the other.
For castles, you should know that the Rhine castles (and there are 40 or so castles in the 40-mile-long Middle Rhine Valley) have seen 700-1,000 years of European history; the Bavarian "castles" are late 19th-century palaces. But there is a lot to see in both regions. Depends on what matters to you.
Frankfurt/Rhine:
I could see 3 nights in Frankfurt with 2 days there and a daytrip to Gelnhausen (35 min. by train) and Büdingen (15 min. beyond Gelnhausen):
A Day Out in Gelnhausen
A Day Out in Büdingen
I could see 4 nights in Boppard with possible outings to Braubach (Marksburg Castle), to St. Goar-Oberwesel-Bacharach (all very close), to Linz am Rhein, to Cochem on the Mosel River, and possibley to Cologne. Mainz is also a very nice place and only a few minutes from FRA. Maybe you squeeze in a Rhine Cruise between Bingen and Boppard as well.
Train service is excellent in these areas and cheap daypasses are available. Rails run along both sides of the scenic Rhine Valley. I'll bet your grandson will find the train option more interesting than the back seat of a car.