This sequence - which I've always read to mean the entire thing (including making love to Mary Magdalene) is taking place in his head whilst he suffers this "last temptation" on the cross - doubtless inspired the finale of The Green Knight (a brilliant film, if you've not seen it).