Have you tried a small delay between each publish? Can you show the whole code, please?
Please use the code fences: