I have this issue with some frequency and it seems to happen across multiple machines at my company. We'll try to send something to media encoder and we'll get an error saying "could not rename file" immediately followed by "AE can't continue: DynamicLinkServer generated an unexpected exception" and then finally "before quitting you have one chance to save" before crashing AE entirely. For example, right now I'm going through a project with quite a number of comps and trying to build a queue of both multiple comps and multiple sections within those comps. Just tonight with over 70 comps I'm exporting I've had already 10-15 crashes.
This can happen on a comp once, but then on second try exports fine. This can be on comps that have plug-ins or comps that have none. It happens on various projects, not just a specific one. I've done restarts, cache clears, etc and the problem remains.
Currently I'm running AE 24.0.0. This is recent-ish issue. I can't remember if the issue originated in AE 2024 or whether it also ran through AE 2023 as well, (maybe) but I'm fairly certain it doesn't go back (for me) into 2022 and earlier than that.