Assuming it wouldn’t create any floor height problems with door swings, I would lay the foam board directly over the top of the existing deck instead of fitting it between the joists (see illustration). Not only would this be a lot easier and faster, but it would also eliminate conductive heat loss through the joists. Plus it helps protect the insulation board from the various problems you mention.
Set the sole plates of the new walls directly on the deck, forming a perimeter for the installation of the insulation. By installing the insulation in two layers as you propose, you will eliminate any thermal short circuits at the wall plates, because the wall insulation between the studs will reach below the top of the rigid insulation (as long...
to read the full article.