I hade the same problem to day and found the answer on this site
https://life.mysiteonline.org/archives/161-Automatic-Post-Creation-with-Wordpress,-PHP,-and-XML-RPC.html
For some reason doesn’t ‘categories’=>array($category) take ID it takes categoryName…
which means that it if you have a category named ODF -> ‘categories’=>array(“ODF”).