My recommended first step would be to upgrade from 4.0.3/4.0.4 to the latest 4.0.x release (currently 4.0.16) .
You can upgrade to either Community or Enterprise Edition, but I’d choose the latter if you have an active subscription. Minor server releases include security and stability improvements but do not introduce any backward-breaking changes. Your current versions of MongoDB were released in 2018 and there have been a quite a few important improvements in the 12 or so subsequent minor releases.
Your Enterprise Advanced subscription also includes access to our global support team, so I would ask questions like this via the Customer Support Portal for more personalised support with SLAs and direct access to our support engineers.
If you are not using an Enterprise storage engine (Encrypted Storage or In-Memory Storage), the data file formats are identical if you want to switch between Community & Enterprise edition server binaries. If you end up using Enterprise storage engines and later want to change to Community edition, you can convert to the standard WiredTiger storage engine (for example, via rolling replica set maintenance) before changing editions.
Installing the Enterprise edition server package should uninstall Community edition (and vice-versa) without affecting your data files. However, I’d always recommend taking a backup before any administrative changes in case something doesn’t go to plan.