What block is the slowest to break with pickaxe?
The Minecraft wiki has a helpful table for the "hardness" of blocks and also their correct tool: https://minecraft.gamepedia.com/Breaking#Blocks_by_hardness (archive)
Since every block only has at most one correct tool (with the exception of swords breaking cobwebs and leaves a bit faster, for which the correct tool is shears), you can see what breaks with normal (hand) speed when using a pickaxe: All that don't have a pickaxe icon next to them. That also often gives you the added mining time for blocks where you don't get the drop due to using the wrong tool.
Haste doesn't matter for this question, because it affects all blocks and tools equally.
So, what is the hardest block that isn't broken faster with a pickaxe? Cobwebs. It takes 20 seconds to mine one by hand. The problem is that it's hard to get. If you need a lot of it, you'll have to explore a lot.
The farmable blocks with the highest hardness are wooden trapdoors and doors (4.5s), then chests, trapped chests and crafting tables (3.75s). They are mined much faster with the wrong tool, because you get the drop.
But there's no other block that breaks slower due to not getting the drop until you get to snow blocks (1s).
If you also have to hold down the "use" button for your AFK machine, then fences, logs, planks, wooden slabs and stairs (3s) might be your best options.
Alternatively, if that's possible in your case, you could design your farm/machine in a way that only water, lava, air or unbreakable blocks are in the direction you'll be mining, for example you could put it on top of the bedrock or hollow out the space behind it and add a water stream to get the drops.
Another option would be to constantly move blocks back and forth in the direction you mine. As long as the time to mine the moved block is longer than the time it stays in one place, you will never break it. Your best options here are the wooden blocks named above, since coal blocks (hardest movable blocks) are mined faster with a diamond pickaxe, even without enchantments.
Entities in the way also work, if you don't need something to place a block against. You can punch something and proceed to mine while still holding down the button, but if you start mining a block, you'll never hit a mob with that same button press. Your best options there are likely snow golems or paintings.