Unfortunately I've found an unwanted side effect of my new solution. The problems just don't seem to go away
As soon as I've started using the cube in real, multiplexed mode, trying out all LEDs in a test pattern, I've noticed that in one column from the 16 that I have in total, the top 3 LEDs are dimly lit all the time. The lowest LED is fine, the one above it, in the same column, is dimly lit, the third one (even higher in the same column) is dimly lit, but not as much as the second one and the fourth one is also dimly lit, but not even as much as the third one. If I remove the 1K resistor which connects the lowest anode layer to ground, then this unwanted effect goes away, but then I'm back to the ghosting
The even more interesting thing is that if I disconnect that column completely from the driving circuit, the top 3 LEDs in that column are still dimly lit, as described above, but when they should really light up at full brightness, they don't (because that column is disconnected). But if the column is disconnected, then it means that they are not grounded at all, so how can they light up, even dimly? And why only this column? And why only when I add a 1K resistor between the lowest anode layer and the ground?