No spray foam. XPS sheets glue to the wall. You can't control the moisture/leak issues because the duct is in the way. Seal the edges of the xps with can foam, as long as you are sure you have no leak issues. If you don't know, don't seal the bottom, unless you are sealing to some kind of french drain. What you want is dead air space behind the xps. The duct itself looks insulated enough not to rust (soft duct?), but the rim joist/joist bay above can't be touched.
I'd test the wall first. Skim coat/stone may not hold a fastener. Coat is too thin and stone may fracture. You may be drilling/screwing into stone mortar joints which may not hold/soft.
If the basement is not high ceiling, the space under the duct maybe too low and already lost as living space. You can fill it with storage/built in and tie it to the visible floor joist. Electrics in metal wire chase/thinwall tubes and outlets in the cabinet back wall.
I'd test the wall first. Skim coat/stone may not hold a fastener. Coat is too thin and stone may fracture. You may be drilling/screwing into stone mortar joints which may not hold/soft.
If the basement is not high ceiling, the space under the duct maybe too low and already lost as living space. You can fill it with storage/built in and tie it to the visible floor joist. Electrics in metal wire chase/thinwall tubes and outlets in the cabinet back wall.