I experienced this while using a STM32f429 discovery board, and I found out there are two reasons that this happens.
- when using a fast microcontroller (180 MHz clock), if you send I2C packet consecutive LCD may not be that fast to understand it and as James said in other post LCD may lose some packet and get confused. To cope with that you have to put a delay between your packet.
- If you reset your board while your LCD is working by the same reason it may lose some packet and may interfere your initialize data as data to show on LCD and simply get confused. If LCD had something like software reset it could help but I did not find anything in datasheet. Sorry for bad English