The problem you have is that the old Buna/Neoprene gasketing is becoming no longer chemically compatible with the 'modern' diesel fuels .... and the old Buna/Neoprene is 'swelling'/ssoftening and essentially 'glueing' itself between the head and bowl of the filter. This is especially evident when there is any 'blend' of reclaimed cooking oil, etc. in the fuel. Back when your engine was designed Neoprene / Buna was compatible with the fuels then being blended ... not always so with todays fuels.
WHEN you so get the housing apart, first inspect to be sure that the gasket hasnt become grossly 'swollen' or become very soft. If so, change the gasket for one made with more 'compatible' rubber materials.
You have two choices when putting the housing back together (and the gasket is not swollen/softened)
1. apply a 'dry' teflon lubricant to the gasket so that the next time you open the housing, the gasket easily 'releases'. Be aware that the 'carriers' of many spray lubricants are incompatible with Buna/Neoprene and make them swell/soften even worse than the newer diesel fuels.
2. Replace the gasket with one made from EPR (ethylene propylene rubber) or EPDM (EthylenePropyleneDiamineMonomer). You may have to measure the gasket grooves of the housing and seek a replacment gasket from an internet source; forget about measuring the old gasket; instead, measure the housing.
Dont expect your Yanmar dealer to be fully 'up to speed' on this ever changing need to change the gasket material.