Warning passing null to substr in Tracker/PageUrl.php

On a self hosted matomo, I irregularly have the following warning on the home page (index.php?module=CoreHome&action=index&idSite=1&period=range&date=last7#?period=range&date=last7&idSite=1&category=Dashboard_Dashboard&subcategory=1) :

WARNING: /core/Tracker/PageUrl.php(396): Deprecated - substr(): Passing null to parameter #1 ($string) of type string is deprecated - Matomo 5.6.2 - Please report this message in the Matomo forums: ``https://forum.matomo.org`` (please do a search first as it might have been reported already) (Module: API, Action: get, Method: VisitsSummary.get, In CLI mode: false)

When it appears, it is listed 4 times in yellow panels before the page’s content.

I could not find any related logs.

It appears irregularly : sometimes 2 times in a row, sometimes it doesnt appear for a lot of calls.