If it happens that Cake throws an error while saving data to a table, check if any of the columns have «reserved» names. My pitfall was use of column named «order» to save item order information, in which order it should be displayed. Turned out «order» is one of the «reserved» column names and so must be «quoted».
Cake has a special option for this kind of cases which is turned off by default. Turn it on in config/app.php, find the following line and set it to true, like so:
'quoteIdentifiers' => true,