Unfortunately, none of the Google apps (YouTube, Duo, Chrome) have this issue because they tend to use only a single Activity, and so when entering or leaving PiP there is no task issue in the recents menu because there is only ever a single task with a single Activity in it. This is why you do not see any entry in the recents menu for these apps when they are in PiP mode; it is being hidden by the APIs.
If you use multiple Activities in your app, then you will run into this issue. This is especially common given that most apps out there will use a new Activity in the task that launched their application to house their video playback.
The best solution I have found is to make your video player Activity be in its own task (set a unique task affinity) and hide it from the recents menu. This results in expected behaviour when entering and exiting PiP as well as allowing the user to navigate throughout the rest of your app (via the other tasks) without interfering with the PiP task. Unfortunately, this means that users will not be able to re-enter your video player from the recents; if the users uses the home or recents buttons, the video player task will end up being destroyed and your player Activity will be finished.
<activity
android:name=".YourVideoPlayerActivity"
android:resizeableActivity="true"
android:configChanges="keyboardHidden|screenSize|smallestScreenSize|screenLayout|orientation"
android:supportsPictureInPicture="true"
android:launchMode="singleTask"
android:taskAffinity=".YourVideoPlayerActivityTask"
android:excludeFromRecents="true"
android:noHistory="true"
android:autoRemoveFromRecents="true" />