When you using 16x4 (instead 20x4) display, then due this line buffer is shifted by 4 chars https://github.com/dhylands/python_lcd/blob/87ca81a7da025b9f60d857c902435bc87dcf842f/lcd/lcd_api.py#L131 when you change this 0x14 to 0x10, it works. I suggest somehow IF it based on LCD_COLS somethings like 0x10 if LCD_COLS==16 else 0x14