Today i got exactly the same behaviour when adding a custom post type. I also noticed some admin post search tools stopped working. My debug_log showed exactly the same notice.
The problem turned out to be some text before the <?php
opening tag (top file) were I register the CPT.
Example
some text here<?php
/**
* @class My_Cpt_Class
*/
.......
The CPT does get registered correctly. I can add posts etc. But a few default post actions (from other plugins aswell) stop working for ALL post types. I have no idea why this happens with this error.