Apple Extended Keyboard 2 - Caps lock key doesn't work in macOS High Sierra?
I found a solution:


  Go to System Preferences > Accessibility
  
  When the accessibility window is open — on the left part of the window
  – click Keyboard
  
  Then there will be the 2 options — for sticky keys, and for slow keys
  — click the box next to slow keys to enable it — then click the
  Options... button – a new window will come up with a slider to change
  the acceptance delay — by default this is in the middle. Slide the
  button all the way to the left, so that it is the shortest time
  possible.


It comes from How to remove caps lock delay on Apple MacBook Pro aluminum keyboard when booted to Linux which also may contains why it did not work from the beginning. 

Thanks to @MattSephton who provided the link in a comment.