I don't know what your problem might be, but I can explain how the values end up in that table.
when a product page is viewed, the event catalog_controller_product_view
is dispatched.
This event is observed by Mage_Reports_Model_Event_Observer::catalogProductView
.
This method just instantiates a model and saves record in the table report_viewed_product_index
Mage::getModel('reports/product_index_viewed')
->setProductId($productId)
->save()
->calculate();
In the _beforeSave method for the model Mage_Reports_Model_Product_Index_Viewed
the visitor id and customer id are set.
Check Mage_Reports_Model_Product_Index_Abstract::_beforeSave
.
I wasn't able to reproduce your issue, but I thought that the stacktrace may help you debug the issue.