Thanks for your posting and using Aspose.Cells.
We have looked into your issue and found error in your code. In the following line, you should use botStyle instead of topStyle
Border botBorder = topStyle.getBorders().getByBorderType(BorderType.BOTTOM_BORDER);
So the correct line will be
Border botBorder = botStyle.getBorders().getByBorderType(BorderType.BOTTOM_BORDER);
Here is a fixed code, changes are highlighted in red. It should fix your issue.