There have been studies of this question by Laudenbach; his papers are clear and efficientby Laudenbach.
Laudenbach, François A Morse complex on manifolds with boundary. Geom. Dedicata 153 (2011), 47–57.
Laudenbach, François The Poincaré-Lefschetz pairing viewed on Morse complexes. Ann. Fac. Sci. Toulouse Math. (6)30(2021), no.4, 801–812.