Below are the symptoms, but it turns out the problem was quite simple: the device is not seem capable of scanning while at the same time being connected, unless you use a long timeout (no Empty PDU packets are sent while scanning).
5 to 10 seconds after connection (independently of whether any notifications are turned on) my peripheral device reports a disconnect for reason 8 (BLE_HCI_CONNECTION_TIMEOUT). This happens with test with three different central devices (Raspberry Pi W, a BLE dongle under linux, and an Android 7 device). All the centrals were verified to have connection intervals within the accepted interval for the peripheral (verified at the BLE_GAP_EVT_CONNECTED and BLE_GAP_EVT_CONN_PARAM_UPDATE).
I have the following configuration for my peripheral device (nrf52832, sdk 15.0.0, the Laird BL652 module):
#define MIN_CONN_INTERVAL 6 // in units of 1.25us
#define MAX_CONN_INTERVAL 100
#define SLAVE_LATENCY 0 // changing this does not change the behavior described below
#define CONN_SUP_TIMEOUT MSEC_TO_UNITS(4000, UNIT_10_MS)
#define FIRST_CONN_PARAMS_UPDATE_DELAY APP_TIMER_TICKS(2000)
#define NEXT_CONN_PARAMS_UPDATE_DELAY APP_TIMER_TICKS(2000)
#define MAX_CONN_PARAMS_UPDATE_COUNT 0 // changing this did not matter - the central device always uses conn interval around 18 to 32, so no updates were called
I am using the synthesized clock (not a low frequency crystal and not the internal RC oscillator), which presumably is high precision, right? For the moment I do not have power constraints.
The power management logger, reports persistent CPU usage of 7%.
In the sniffer log under wireshark one can see that after connection the master and slave are exchanging "Empty PDU" packets for a few seconds up until packet 529 when only the master continues sending such packets. After half a second the master stops sending these unacknowledged packets as well. A few more seconds later I see that the slave resumes advertising, given that the connection has been lost. The log is attached (device d8:9a:ab:e5:5c:b5 is the slave of interest).
Any idea what would be causing the slave to stop responding? It does not seem like it is clock drift (the synth clock is precise) or an unacknowledged parameter update (no parameter updates happen because the initial connection parameters are fine).
Edit: the slave was not responding because separately the slave was also performing scans for packets from beacons. It was rather naive of me not to mention that first.