After reading through all the documentation again I figured out where the error is:
Where the tutorial in the beginning of this thread indicates “Include the card code in your `ui-lovelace-card.yaml” it actually should write “Include the card code in your ui-lovelace.yaml”
A small and subtle difference, but by including the code in ui-lovelace.yaml I managed to get it to work