Background
The adxl362 driver native to the zephyr kernel doesn't support FIFO operations, so I built my own out-of-tree driver that relies on a new accelerometer API instead of sensor. Anyway, all of my standard read/write register SPI transactions work as expected (I am using zephyrs adxl362_reg_access() function). Normal register access follows a paradigm where you write a command byte, a register address, then you either issue a dummy byte(s) or you write a value(s). The FIFO read works a little differently because there is no address byte in the sequence. To address this, I wrote a adxl362_fifo_access() function.
Problem
The problem I'm having is the read always returns the correct FIFO data back, but with a 0x00 byte in the first position of the buffer (Figure 0). I painstakingly soldered wires on the adxl362 and captured the transaction using a logic analyzer (See Figure 1). The data looks normal, with no zero byte present.
Workaround
I was able to hack the read operation to make my program work by adding one more byte to my buffer to allow the nuisance byte. In this case it seems like I'm missing something about using the SPI library. Any advice?

Figure 0: Debugger perspective showing the problem byte.
Figure 1: Logic Analyzer plot showing the FIFO read command (0x0D), followed by a 10us delay, then reading in the data. Note: This was not the same capture from Figure 0.

Figure 2: Device Tree for Accelerometer
static int adxl362_fifo_access(const struct device *dev, void *data, size_t length){
const struct adxl362_config *cfg = dev->config;
uint8_t access[1] = {ADXL362_WRITE_FIFO};
const struct spi_buf tx_buf = {
.buf = access,
.len = 1
};
const struct spi_buf_set tx = {
.buffers = &tx_buf,
.count = 1
};
const struct spi_buf rx_buf = {
.buf = data,
.len = length
};
const struct spi_buf_set rx = {
.buffers = &rx_buf,
.count = 1
};
return spi_transceive_dt(&cfg->bus, &tx, &rx);
}
/*
* Usage
*/
#define FIFO_BUFFER_SIZE 1024 + 1 // Workaround the prepended 0 byte.
#define FIFO_BUFFER_START_OFFSET 1
uint8_t buffer[FIFO_BUFFER_SIZE] = {0};
adxl362_fifo_access(dev, buffer, FIFO_BUFFER_SIZE);
Figure 2: Function used to read the FIFO buffer, with implementation.