Hmmm... A few issues I see:
I would use the message type to indicate who the message is intended for. In this simple case, it may be sufficient to just have type types (parent to child and child to parent).
Child process should send to parent with a message type indicating child to parent and should receive with a message type indicating parent to child.
Parent process should receive a message with a message type indicating child to parent from every child, not just one and send with a message type indicating parent to child.
The parent process iterates off the end of the array called "array". Use -fsanitize=address to help find where these things are happening.
=================================================================
==12728==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fffffffe448 at pc 0x5555555559c9 bp 0x7fffffffe360 sp 0x7fffffffe350
READ of size 4 at 0x7fffffffe448 thread T0
#0 0x5555555559c8 in main testMsgQueue5.c:97
#1 0x7ffff73a9d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
#2 0x7ffff73a9e3f in __libc_start_main_impl ../csu/libc-start.c:392
#3 0x555555555324 in _start (a.out+0x1324)
Address 0x7fffffffe448 is located in stack of thread T0 at offset 168 in frame
#0 0x5555555553f8 in main testMsgQueue5.c:27
This frame has 4 object(s):
[32, 40) 'aux' (line 71)
[64, 80) 'manejador_mensaje' (line 41)
[96, 112) 'recibido' (line 72)
[128, 160) 'array' (line 73) <== Memory access at offset 168 overflows this variable
There may be other problems, but those are the ones I see right now.