Hi,
RabbitMQ 3.9 does work with that Erlang version (although, again, you are going through some serious trouble to downgrade Erlang for no apparent reason - you will just end up maintaining a custom Docker image with worse performance). But to build an image like that, simply changing the Erlang version is clearly not sufficient.
The problem is RabbitMQ CLIs are written in Elixir, which is another language that works on the same Erlang VM. I believe what happens in your case is you end up with Elixir that was built on Erlang 24 (because you are modifying an image that assumes Erlang 24 is being used) but then you try to start the app on Erlang 23, which is not supported (RabbitMQ is not even in the picture - it's a matter of compatibility between compiled files and the virtual machine they were compiled for).
TL;DR:
1. I'd strongly recommend just using the image as is, with Erlang 24
2. If you really want to customise the image, you need to take care of the Elixir version as well, and make sure you don't try to run programs compiled using Erlang 24, on Erlang 23 virtual machine / runtime.
Best,