altering a block that is embedded in a view
I assume you're displaying a block_content entity.

That is not actually rendered through the block system, it's an entity, so you need to implement hook_block_content_view() (see hook_ENTITY_TYPE_view() for documentation)