This is an issue transferred from spatstat (spatstat/spatstat#133) because of the package splitup.
Several users have reported erroneous results from density.lpp/densityHeat in which the highest values of density occur at locations far away from the nearest data point. I do not yet have a minimal working example. The bug seems to arise when the network contains very short segments (e.g. shorter than 1 metre in a road network that is 10-100 km wide). This is being investigated.