Now that you have it working, disable the FreePBX DAHDI “update” function.
it’s OK to use it to look at your DAHDI configuration and state, but don’t let the system update or rewrite the DAHDI config files. There’s a switch in the FreePBX pages that turns on “enable writes to config files” (or something similar). Now that everything is working, turn that off so that you don’t install an update to a module and suddenly have to remember how you fixed it.
An alternative is to simply disable the DAHDI modules in FreePBX. Your config is working - there’s no reason to mess with it until you update DAHDI versions, and because of your specific hardware configuration, you should do that deliberately, with planning, and under your complete control - just like you did this time.